-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Extend generic static bug #17829
Copy link
Copy link
Closed
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeBugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.4.0
Code
function base<T>() {
class Base {
static prop: T;
}
return Base;
}
class Gen<T> extends base<T>() {}
class Spec extends Gen<string> {}
<string>Spec.prop;Expected behavior: Either the static property prop is of type string or I'm given an error to prevent this happening earlier with clear error message.
Actual behavior: It claims that prop is of type T.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeBugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue