Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type inference broken for this in master #5056

Closed
MaceWindu opened this issue Oct 1, 2015 · 2 comments
Closed

Type inference broken for this in master #5056

MaceWindu opened this issue Oct 1, 2015 · 2 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@MaceWindu
Copy link

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;
        }
    }
}
@MaceWindu
Copy link
Author

Looks like it's due to this feature #4910. Gonna read it carefully - not sure wether it expected behavior or not.

@MaceWindu
Copy link
Author

ok, looks like its expected behavior...

@RyanCavanaugh RyanCavanaugh added the Question An issue which isn't directly actionable in code label Oct 28, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

2 participants