We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Version: 2.0.3
Code
With --strictNullChecks,
--strictNullChecks
class A { constructor() { } method() { } } let a: A | null = null; try { a = new A(); } finally { if (a) { a.method(); } }
Expected behavior:
I expect this to compile. TypeScript should be able to deduce that a can be of type A at the a.method() call site.
a
A
a.method()
Actual behavior:
I get an error message
Property 'method' does not exist on type 'never'.
Note that it works fine if the try and finally lines are removed.
The text was updated successfully, but these errors were encountered:
I can confirm this with the nightly build 2.1.0-dev.20161015 too.
2.1.0-dev.20161015
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
TypeScript Version: 2.0.3
Code
With
--strictNullChecks
,Expected behavior:
I expect this to compile. TypeScript should be able to deduce that
a
can be of typeA
at thea.method()
call site.Actual behavior:
I get an error message
Property 'method' does not exist on type 'never'.
Note that it works fine if the try and finally lines are removed.
The text was updated successfully, but these errors were encountered: