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
"Only refers to a type, but is being used as a namespace here" TS202
"Cannot find name" TS2304
"Instantiation Expressions"
🕗 Version & Regression Information
I tried this in Nightly 5.1.0-dev.20230313, 4.7.4, 4.8.4, and 4.9.5 - the versions that support Instantiation Expressions on the playground but it does not complain. This does not cause my build to fail - only the Language Server complains locally.
But the same code in VSCode latest with nightly typescript:
And I hope I'm showing that the right version of tsserver is being used (it would be nice if the TSServer startup announced its version for confirmation).
💻 Code
classFoo<TextendsObject,Cextends{}>{privateconstructor(value : T,context: C){}staticreadonlymakeFoo=<Cextends{}>(context : C)=><TextendsObject>(value : T)=>newFoo<T,C>(value,context);}constx=Foo.makeFoo<{}>;// Cannot find name 'Foo'.ts(2304)// 'Foo' only refers to a type, but // is being used as a namespace here.ts(2702)x({});// 👍 `const x: <{}>(context: {}) => <T>(value: T) => Foo<T, {}>`
Strangely, the language server is still able to give the right types for that and future related code.
🙁 Actual behavior
Non-blocking errors TS202 TS2304 on the Instantiation Expressions involving a generic static method.
🙂 Expected behavior
Should be OK or have a fully blocking error (hopefully with enough information to fix)
The text was updated successfully, but these errors were encountered:
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
I tried this in Nightly 5.1.0-dev.20230313, 4.7.4, 4.8.4, and 4.9.5 - the versions that support Instantiation Expressions on the playground but it does not complain. This does not cause my build to fail - only the Language Server complains locally.
⏯ Playground Link
NOT exhibited in playground: Playground link with relevant code
But the same code in VSCode latest with nightly typescript:
And I hope I'm showing that the right version of tsserver is being used (it would be nice if the TSServer startup announced its version for confirmation).
💻 Code
Strangely, the language server is still able to give the right types for that and future related code.
🙁 Actual behavior
Non-blocking errors TS202 TS2304 on the Instantiation Expressions involving a generic static method.
🙂 Expected behavior
Should be OK or have a fully blocking error (hopefully with enough information to fix)
The text was updated successfully, but these errors were encountered: