41 lines
676 B
Text
41 lines
676 B
Text
|
=== tests/cases/compiler/genericStaticAnyTypeFunction.ts ===
|
||
|
class A {
|
||
|
>A : A
|
||
|
|
||
|
static one<T>(source: T, value: number): T {
|
||
|
>one : <T>(source: T, value: number) => T
|
||
|
>T : T
|
||
|
>source : T
|
||
|
>T : T
|
||
|
>value : number
|
||
|
>T : T
|
||
|
|
||
|
return source;
|
||
|
>source : T
|
||
|
|
||
|
}
|
||
|
static goo() { return 0; }
|
||
|
>goo : () => number
|
||
|
|
||
|
static two<T>(source: T): T {
|
||
|
>two : <T>(source: T) => T
|
||
|
>T : T
|
||
|
>source : T
|
||
|
>T : T
|
||
|
>T : T
|
||
|
|
||
|
return this.one<T>(source, 42); // should not error
|
||
|
>this.one<T>(source, 42) : T
|
||
|
>this.one : <T>(source: T, value: number) => T
|
||
|
>this : typeof A
|
||
|
>one : <T>(source: T, value: number) => T
|
||
|
>T : T
|
||
|
>source : T
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|