35 lines
No EOL
1.3 KiB
Text
35 lines
No EOL
1.3 KiB
Text
tests/cases/compiler/collisionSuperAndLocalFunctionInConstructor.ts(12,9): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
tests/cases/compiler/collisionSuperAndLocalFunctionInConstructor.ts(20,13): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
|
|
|
|
==== tests/cases/compiler/collisionSuperAndLocalFunctionInConstructor.ts (2 errors) ====
|
|
function _super() { // No error
|
|
}
|
|
class Foo {
|
|
constructor() {
|
|
function _super() { // No error
|
|
}
|
|
}
|
|
}
|
|
class b extends Foo {
|
|
constructor() {
|
|
super();
|
|
function _super() { // Should be error
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
}
|
|
~~~~~~~~~
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
}
|
|
}
|
|
class c extends Foo {
|
|
constructor() {
|
|
super();
|
|
var x = () => {
|
|
function _super() { // Should be error
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
}
|
|
~~~~~~~~~~~~~
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
}
|
|
}
|
|
} |