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
This is confusing because from just hovering over instance, the type is Foo; however, I think what's happening is that we have different type-checker modes, and new Foo() produces something different from each type-checker.
new Foo() in our error-producing type-checker returns the internal error type that works like any because it tries to avoid cascading errors on subsequent operations. However, operations like quick info and auto-completerely on a more lax type-checker that tries to get results of operations in a best-effort way and produces the type Foo. However, that more relaxed checker isn't the same type-checker instance that produces errors, so you don't get an error on that subsequent operation.
TypeScript Version: 3.5.3
Search Terms:
ts-ignore in class constructor
class method no error on parameter usage
Code
Expected behavior:
The invocation of
instance.baz('buzz')
should report that the parameter should be anumber
instead of astring
.Actual behavior:
There is no error on that line.
If I fix the ts-ignore on the line above, it then reports the error correctly.
Playground Link:
http://www.typescriptlang.org/play/?ts=3.8.0-dev.20200116#code/MYGwhgzhAEBiD29oG8BQ1oCMwCcBc0EALjgJYB2A5utMPOcTgK7BHw4AU2+hJFlAShQ0MRABakIAOm7QAvFlw0AvqhrYAXlyYaNBckwC2mAKY4haDBhwmiTHOSw6N0ANTQAjCtSrUAej9oAAEiCABaUkpydhNUOgYiaApiMHJgE3lochMAdzhEDgFUZKJU9JkwLQByTGcqgSA
Related Issues:
Could not find any through Google or here.
The text was updated successfully, but these errors were encountered: