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