Skip to content

Type inference broken for this in master #5056

Closed
@MaceWindu

Description

@MaceWindu
module Bug {
    export class BugClass {
        public fail(): void {
            var x = this;
            x = x.getself(); // error TS2322: Type 'BugClass' is not assignable to type 'this'.
        }

        public getself(): BugClass {
            return this;
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions