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

28 lines
1.2 KiB
Plaintext
Raw Normal View History

tests/cases/compiler/collisionThisExpressionAndLocalVarInProperty.ts(4,17): error TS2399: Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.
tests/cases/compiler/collisionThisExpressionAndLocalVarInProperty.ts(12,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/collisionThisExpressionAndLocalVarInProperty.ts (2 errors) ====
class class1 {
public prop1 = {
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);
}
}
}
class class2 {
constructor() {
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
}
public prop1 = {
doStuff: (callback) => () => {
return callback(this);
}
}
}