TypeScript/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.errors.txt
2014-09-12 13:35:07 -07:00

15 lines
657 B
Plaintext

tests/cases/compiler/collisionThisExpressionAndLocalVarInLambda.ts(5,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
==== tests/cases/compiler/collisionThisExpressionAndLocalVarInLambda.ts (1 errors) ====
declare function alert(message?: any): void;
var x = {
doStuff: (callback) => () => {
var _this = 2;
~~~~~
!!! error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
return callback(this);
}
}
alert(x.doStuff(x => alert(x)));