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 would expect that the second legacyMethod call to also be fine, due to the = suffix on the type (see https://developers.google.com/closure/compiler/docs/js-for-compiler#types for more details on the Closure Compiler type language). Based on Visual Studio Code's Intellisense the extracted type for legacyMethod is function legacyMethod(input?: number): number which seems correct. However, when running, I get:
main.ts(2,13): error TS2346: Supplied parameters do not match any signature of call target.
Out of curiosity, I tried legacyMethod(undefined) which worked (as did legacyMethod(null), which the Closure Compiler would not have allowed, since optional parameters are undefined, not null).
The text was updated successfully, but these errors were encountered:
TypeScript Version: nightly (1.9.0-dev.20160521) (same behavior in 1.8.10).
Given this plain JavaScript file annotated with JSDoc for the Closure Compiler (included via
allowJs
):And this TypeScript file:
I would expect that the second
legacyMethod
call to also be fine, due to the=
suffix on the type (see https://developers.google.com/closure/compiler/docs/js-for-compiler#types for more details on the Closure Compiler type language). Based on Visual Studio Code's Intellisense the extracted type forlegacyMethod
isfunction legacyMethod(input?: number): number
which seems correct. However, when running, I get:main.ts(2,13): error TS2346: Supplied parameters do not match any signature of call target.
Out of curiosity, I tried
legacyMethod(undefined)
which worked (as didlegacyMethod(null)
, which the Closure Compiler would not have allowed, since optional parameters are undefined, not null).The text was updated successfully, but these errors were encountered: