TypeScript/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.errors.txt

15 lines
657 B
Plaintext
Raw Normal View History

tests/cases/compiler/collisionThisExpressionAndLocalVarInLambda.ts(5,13): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
2014-07-19 01:13:21 +02:00
==== 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.
2014-07-19 01:13:21 +02:00
return callback(this);
}
}
alert(x.doStuff(x => alert(x)));