Closed
Description
TypeScript Version: 2.4.1
Code
interface A {
a: number;
}
interface B extends A {
b: number;
}
function x(b: B): void {}
const y: <C extends A>(c: C) => void = x;
Expected behavior:
No Type Error
Actual behavior:
Type error with message :
Type '(b: B) => void' is not assignable to type '<C extends A>(c: C) => void'.
Types of parameters 'b' and 'c' are incompatible.
Type 'C' is not assignable to type 'B'.
Type 'A' is not assignable to type 'B'.
Property 'b' is missing in type 'A'.
Comment
Weirdly, it doesn't show any errors on Playground, but it shows errors when compiled on local project.
Metadata
Metadata
Assignees
Labels
No labels