Skip to content

Support 'static' to be used with 'abstract' and generic type #10603

Closed
@k8w

Description

@k8w

TypeScript Version: 2.0.0

Code

abstract Class BaseClass<T>{
    abstract static defaultValue:T;
    // ...
}

interface Format{
    //...
}

class ClassA extends BaseClass<Format>{
    static defaultValue:Format = { ... }
}

Expected behavior:
Can define static member in abstract class, so that force child classes contains it.
Such as defaultProps in React.Component

Actual behavior:
Neither interface nor abstract class can achieve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions