Skip to content

Argument of type 'this' is not assignable to parameter of type 'this'. #5449

Closed
@vilicvane

Description

@vilicvane

This error also appears on generics with this to the super call (which is the real use case).

class A {
    constructor(bar: this) { }
    foo(bar: this) { }
}

class B extends A {
    constructor() {
        super(this); // Error
        this.foo(this); // Works
    }
}

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions