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
I expected the following code to produce an error as function a could pass an argument that is not a string to function b.
Code:
declare function a(f: (v: Object) => string): void
declare function b(f: string): string
a(b)
Expected Result:
error TS2345: Argument of type '(f: string) => string' is not assignable to parameter of type '(v: Object) => string'.
Types of parameters 'f' and 'v' are incompatible.
Type 'Object' is not assignable to type 'string'.
Actual Result:
No error
The text was updated successfully, but these errors were encountered:
I expected the following code to produce an error as function a could pass an argument that is not a string to function b.
Code:
Expected Result:
Actual Result:
No error
The text was updated successfully, but these errors were encountered: