49 lines
2.9 KiB
Plaintext
49 lines
2.9 KiB
Plaintext
tests/cases/compiler/genericMemberFunction.ts(2,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
tests/cases/compiler/genericMemberFunction.ts(7,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
tests/cases/compiler/genericMemberFunction.ts(10,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
tests/cases/compiler/genericMemberFunction.ts(15,19): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
tests/cases/compiler/genericMemberFunction.ts(16,5): error TS2304: Cannot find name 'a'.
|
|
tests/cases/compiler/genericMemberFunction.ts(17,5): error TS2304: Cannot find name 'removedFiles'.
|
|
tests/cases/compiler/genericMemberFunction.ts(17,30): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
tests/cases/compiler/genericMemberFunction.ts(18,12): error TS2339: Property 'removeFile' does not exist on type 'BuildResult<A, B, C>'.
|
|
|
|
|
|
==== tests/cases/compiler/genericMemberFunction.ts (8 errors) ====
|
|
export class BuildError<A, B, C>{
|
|
public parent<A, B extends A, C>(): FileWithErrors<A, B, C> {
|
|
~~~~~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
return undefined;
|
|
}
|
|
}
|
|
export class FileWithErrors<A, B, C>{
|
|
public errors<A, B extends A, C>(): BuildError<A, B, C>[] {
|
|
~~~~~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
return undefined;
|
|
}
|
|
public parent<A, B extends A, C>(): BuildResult<A, B, C> {
|
|
~~~~~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
return undefined;
|
|
}
|
|
}
|
|
export class BuildResult<A, B, C>{
|
|
public merge<A, B extends A, C>(other: BuildResult<A, B, C>): void {
|
|
~~~~~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
a.b.c.d.e.f.g = 0;
|
|
~
|
|
!!! error TS2304: Cannot find name 'a'.
|
|
removedFiles.forEach(<A, B extends A, C>(each: FileWithErrors<A, B, C>) => {
|
|
~~~~~~~~~~~~
|
|
!!! error TS2304: Cannot find name 'removedFiles'.
|
|
~~~~~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
this.removeFile(each);
|
|
~~~~~~~~~~
|
|
!!! error TS2339: Property 'removeFile' does not exist on type 'BuildResult<A, B, C>'.
|
|
});
|
|
}
|
|
}
|
|
|