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