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

[Errors] _this in reserved positions #64

Closed
mhegazy opened this issue Jul 17, 2014 · 0 comments · Fixed by #155
Closed

[Errors] _this in reserved positions #64

mhegazy opened this issue Jul 17, 2014 · 0 comments · Fixed by #155
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Jul 17, 2014

//==== tests/cases/compiler/collisionThisExpressionAndAliasInGlobal.ts (1 errors) ====
module a {
   export var b = 10;
}
var f = () => this;
import _this = a; // Error
//!!! Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.

Expected: errors as above
Actual: no errors

Similar but different error:

//==== tests/cases/compiler/collisionThisExpressionAndAmbientClassInGlobal.ts (1 errors) ====
declare class _this { // no error - as no code generation
}
var f = () => this;
var a = new _this(); // Error
//!!! Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.
@mhegazy mhegazy added this to the TypeScript 1.1 milestone Jul 17, 2014
@vladima vladima removed the Fixed label Aug 5, 2014
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants