42 lines
703 B
Text
42 lines
703 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
|
|
>0 : 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
|
|
>42 : number
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|