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
class decorator, static member
https://www.typescriptlang.org/play?ts=5.5.0-dev.20240226#code/GYVwdgxgLglg9mABAQwCaoPrADwBUB8AFFMgE4DmAplAFyJiUDuhAlALz64A0i0AHnWRgAnizqEGzdpxaIAZIgDeiYONkd6IALYAjSqUQBfJQChEiUtRCkkAeR0ArStAB0yAM7uY5MMTJUoHmVVRFYOAEYjFhNDExMAATRMYBMIABsPd0QAZVNY1IR3ODTKFzS4ckJsl2BWFgBuEyA
function add_f<T>(target: new()=>T, ctx: any): (new()=>T) & { f: () => number } { return Object.assign(target, { f: ()=>1 }) } @add_f class S { } console.log(S.f());
.d.ts emits:
declare class S { }
Errors include:
Property 'f' does not exist on type 'typeof S'.
Runtime behavior is correct: it prints 1.
1
declare class S { static f(): number; }
No error.
No response
The text was updated successfully, but these errors were encountered:
Looks like #4881
Sorry, something went wrong.
No branches or pull requests
π Search Terms
class decorator, static member
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?ts=5.5.0-dev.20240226#code/GYVwdgxgLglg9mABAQwCaoPrADwBUB8AFFMgE4DmAplAFyJiUDuhAlALz64A0i0AHnWRgAnizqEGzdpxaIAZIgDeiYONkd6IALYAjSqUQBfJQChEiUtRCkkAeR0ArStAB0yAM7uY5MMTJUoHmVVRFYOAEYjFhNDExMAATRMYBMIABsPd0QAZVNY1IR3ODTKFzS4ckJsl2BWFgBuEyA
π» Code
π Actual behavior
.d.ts emits:
Errors include:
Runtime behavior is correct: it prints
1
.π Expected behavior
.d.ts emits:
No error.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: