TypeScript/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.errors.txt
2014-09-11 16:11:08 -07:00

53 lines
2 KiB
Plaintext

==== tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts (10 errors) ====
var _super = 10; // No Error
class Foo {
get prop1(): number {
~~~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
var _super = 10; // No error
return 10;
}
set prop1(val: number) {
~~~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
var _super = 10; // No error
}
}
class b extends Foo {
get prop2(): number {
~~~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
var _super = 10; // Should be error
~~~~~~
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
return 10;
}
set prop2(val: number) {
~~~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
var _super = 10; // Should be error
~~~~~~
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
}
}
class c extends Foo {
get prop2(): number {
~~~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
var x = () => {
var _super = 10; // Should be error
~~~~~~
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
}
return 10;
}
set prop2(val: number) {
~~~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
var x = () => {
var _super = 10; // Should be error
~~~~~~
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
}
}
}