Skip to content

Type inference broken for this in master #5056

@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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions