You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lack of type checking for callback parameters #15579
$ node built/local/tsc.js index.ts --noEmit --strict
index.ts(3,3): error ...
index.ts(4,11): error TS2345: Argument of type 'Event' is not assignable to parameter of type 'MouseEvent'.
Property 'altKey' is missing in type 'Event'.
Actual behavior:
$ node built/local/tsc.js index.ts --noEmit --strict
index.ts(4,11): error TS2345: Argument of type 'Event' is not assignable to parameter of type 'MouseEvent'.
Property 'altKey' is missing in type 'Event'.
I didn't know that well because the FAQ doesn't say specific definitions of types of Animal and Dog. But it seems like you can keep the consistency of f(g) and f(ev => g(ev)). Are you really choosing the current inconsistency?
Activity
mhegazy commentedon May 5, 2017
https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-function-parameters-bivariant
falsandtru commentedon May 6, 2017
I didn't know that well because the FAQ doesn't say specific definitions of types of Animal and Dog. But it seems like you can keep the consistency of
f(g)andf(ev => g(ev)). Are you really choosing the current inconsistency?RyanCavanaugh commentedon May 8, 2017
Suffice to say we've thought about this problem a lot and are sticking with the current situation.