Skip to content

Extend generic static bug #17829

Closed
Closed
@mushishi78

Description

@mushishi78

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.

Metadata

Metadata

Assignees

Labels

Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions