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
Property does not exist on type '(Anonymous class)' #14860
Actual behavior:
testbug.ts(11,14): error TS2339: Property 'methodB' does not exist on type '(Anonymous class)'.
And if you replace this.methodB with this.methodA it typechecks fine when it should not.
This didn't happen in earlier versions, Version 2.0.0 works as expected.
Caching in control flow analysis goes wrong. It requires a loop and a reference to this inside of methodA, so it's a fairly specific set of conditions that triggers it.
Fix is up at #15032. The problem was that control flow was treating this like a normal variable reference and walking outside the class expression to try to narrow it. Because of caching, the first type that control flow analysis found for this ({ methodA() { }) was used for this everywhere.
Activity
sandersn commentedon Mar 31, 2017
Caching in control flow analysis goes wrong. It requires a loop and a reference to
thisinside ofmethodA, so it's a fairly specific set of conditions that triggers it.sandersn commentedon Apr 5, 2017
Fix is up at #15032. The problem was that control flow was treating
thislike a normal variable reference and walking outside the class expression to try to narrow it. Because of caching, the first type that control flow analysis found for this ({ methodA() { }) was used forthiseverywhere.