39 lines
No EOL
1.4 KiB
Text
39 lines
No EOL
1.4 KiB
Text
==== tests/cases/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.ts (4 errors) ====
|
|
class a {
|
|
}
|
|
|
|
class b1 extends a {
|
|
constructor(_super: number) { // should be error
|
|
~~~~~~~~~~~~~~
|
|
!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
super();
|
|
}
|
|
}
|
|
|
|
class b2 extends a {
|
|
constructor(private _super: number) { // should be error
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
super();
|
|
}
|
|
}
|
|
|
|
class b3 extends a {
|
|
constructor(_super: number); // no code gen - no error
|
|
constructor(_super: string);// no code gen - no error
|
|
constructor(_super: any) { // should be error
|
|
~~~~~~~~~~~
|
|
!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
super();
|
|
}
|
|
}
|
|
|
|
class b4 extends a {
|
|
constructor(_super: number); // no code gen - no error
|
|
constructor(_super: string);// no code gen - no error
|
|
constructor(private _super: any) { // should be error
|
|
~~~~~~~~~~~~~~~~~~~
|
|
!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
super();
|
|
}
|
|
} |