2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts (10 errors) ====
|
|
|
|
var _super = 10; // No Error
|
|
|
|
class Foo {
|
|
|
|
get prop1(): number {
|
|
|
|
~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-07-13 01:04:16 +02:00
|
|
|
var _super = 10; // No error
|
|
|
|
return 10;
|
|
|
|
}
|
|
|
|
set prop1(val: number) {
|
|
|
|
~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-07-13 01:04:16 +02:00
|
|
|
var _super = 10; // No error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
class b extends Foo {
|
|
|
|
get prop2(): number {
|
|
|
|
~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-07-13 01:04:16 +02:00
|
|
|
var _super = 10; // Should be error
|
2014-07-19 02:30:06 +02:00
|
|
|
~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
2014-07-13 01:04:16 +02:00
|
|
|
return 10;
|
|
|
|
}
|
|
|
|
set prop2(val: number) {
|
|
|
|
~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-07-13 01:04:16 +02:00
|
|
|
var _super = 10; // Should be error
|
2014-07-19 02:30:06 +02:00
|
|
|
~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
class c extends Foo {
|
|
|
|
get prop2(): number {
|
|
|
|
~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-07-13 01:04:16 +02:00
|
|
|
var x = () => {
|
|
|
|
var _super = 10; // Should be error
|
2014-07-19 02:30:06 +02:00
|
|
|
~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
return 10;
|
|
|
|
}
|
|
|
|
set prop2(val: number) {
|
|
|
|
~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
2014-07-13 01:04:16 +02:00
|
|
|
var x = () => {
|
|
|
|
var _super = 10; // Should be error
|
2014-07-19 02:30:06 +02:00
|
|
|
~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|