This was we don't get noisy baselines just because a different phase of the compiler reported the diagnostic. This helps with Yui's refactoring work to move grammar checks into the type checker.
92 lines
No EOL
4.7 KiB
Text
92 lines
No EOL
4.7 KiB
Text
tests/cases/compiler/collisionSuperAndParameter.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
tests/cases/compiler/collisionSuperAndParameter.ts(17,22): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
tests/cases/compiler/collisionSuperAndParameter.ts(21,7): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
tests/cases/compiler/collisionSuperAndParameter.ts(26,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
tests/cases/compiler/collisionSuperAndParameter.ts(26,11): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
tests/cases/compiler/collisionSuperAndParameter.ts(32,19): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
tests/cases/compiler/collisionSuperAndParameter.ts(35,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
tests/cases/compiler/collisionSuperAndParameter.ts(52,17): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
tests/cases/compiler/collisionSuperAndParameter.ts(57,7): error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
|
|
|
|
==== tests/cases/compiler/collisionSuperAndParameter.ts (9 errors) ====
|
|
class Foo {
|
|
a() {
|
|
var lamda = (_super: number) => { // No Error
|
|
return x => this; // New scope. So should inject new _this capture
|
|
}
|
|
}
|
|
b(_super: number) { // No Error
|
|
var lambda = () => {
|
|
return x => this; // New scope. So should inject new _this capture
|
|
}
|
|
}
|
|
set c(_super: number) { // No error
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
}
|
|
}
|
|
class Foo2 extends Foo {
|
|
x() {
|
|
var lamda = (_super: number) => { // Error
|
|
~~~~~~~~~~~~~~
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
return x => this; // New scope. So should inject new _this capture
|
|
}
|
|
}
|
|
y(_super: number) { // Error
|
|
~~~~~~~~~~~~~~
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
var lambda = () => {
|
|
return x => this; // New scope. So should inject new _this capture
|
|
}
|
|
}
|
|
set z(_super: number) { // Error
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
~~~~~~~~~~~~~~
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
}
|
|
public prop3: {
|
|
doStuff: (_super: number) => void; // no error - no code gen
|
|
}
|
|
public prop4 = {
|
|
doStuff: (_super: number) => { // should be error
|
|
~~~~~~~~~~~~~~
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
}
|
|
}
|
|
constructor(_super: number) { // should be error
|
|
~~~~~~~~~~~~~~
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
super();
|
|
}
|
|
}
|
|
declare class Foo3 extends Foo {
|
|
x();
|
|
y(_super: number); // No error - no code gen
|
|
constructor(_super: number); // No error - no code gen
|
|
public prop2: {
|
|
doStuff: (_super: number) => void; // no error - no code gen
|
|
};
|
|
public _super: number; // No error
|
|
}
|
|
|
|
class Foo4 extends Foo {
|
|
constructor(_super: number); // no code gen - no error
|
|
constructor(_super: string);// no code gen - no error
|
|
constructor(_super: any) { // should be error
|
|
~~~~~~~~~~~
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
super();
|
|
}
|
|
y(_super: number); // no code gen - no error
|
|
y(_super: string); // no code gen - no error
|
|
y(_super: any) { // Error
|
|
~~~~~~~~~~~
|
|
!!! error TS2401: Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.
|
|
var lambda = () => {
|
|
return x => this; // New scope. So should inject new _this capture
|
|
}
|
|
}
|
|
} |