31 lines
No EOL
948 B
Text
31 lines
No EOL
948 B
Text
==== 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
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
}
|
|
~~~~~~~~~
|
|
!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
}
|
|
}
|
|
class c extends Foo {
|
|
constructor() {
|
|
super();
|
|
var x = () => {
|
|
function _super() { // Should be error
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
}
|
|
~~~~~~~~~~~~~
|
|
!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
}
|
|
}
|
|
} |