Skip to content

Inheriting constructor through extends clause with a wrapped type argument does not work #1424

Closed
@JsonFreeman

Description

@JsonFreeman

The following code should compile just fine, but there is an error when doesNotWork tries to pass this to the constructor for CBase.

class C<T1> extends CBase<T1> {
    public works() {
        new CBaseBase<Wrapper<T1>>(this);
    }
    public doesNotWork() {
        new CBase<T1>(this);
    }

    public method(t: Wrapper<T1>) { }
}

class CBase<T2> extends CBaseBase<Wrapper<T2>> {

}

class CBaseBase<T3> {
    constructor(x: Parameter<T3>) { }
}

class Parameter<T4> {
    method(t: T4) { }
}

class Wrapper<T5> {
    property: T5;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA 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