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
Error on this.#assert: Assertions require every name in the call target to be declared with an explicit type annotation.(2775)
AFAICT this is caused by getTypeOfDottedName using getPropertyOfType with property name #assert, which doesn't work for private identifiers. Instead is looks for a regular property with name '#assert'. If I add '#assert': (v: any) => asserts v = (v) => {}; the error goes away.
TypeScript Version: 4.2.0-dev.20201231
Search Terms: private assert
Expected behavior:
Both methods work the same, no compile error.
Actual behavior:
Error on
this.#assert
:Assertions require every name in the call target to be declared with an explicit type annotation.(2775)
AFAICT this is caused by
getTypeOfDottedName
usinggetPropertyOfType
with property name#assert
, which doesn't work for private identifiers. Instead is looks for a regular property with name'#assert'
. If I add'#assert': (v: any) => asserts v = (v) => {};
the error goes away.Code
Playground Link: Provided
The text was updated successfully, but these errors were encountered: