22 lines
386 B
Text
22 lines
386 B
Text
=== tests/cases/compiler/genericParameterAssignability1.ts ===
|
|
function f<T>(x: T): T { return null; }
|
|
>f : <T>(x: T) => T
|
|
>T : T
|
|
>x : T
|
|
>T : T
|
|
>T : T
|
|
>null : null
|
|
|
|
var r = <T>(x: T) => x;
|
|
>r : <T>(x: T) => T
|
|
><T>(x: T) => x : <T>(x: T) => T
|
|
>T : T
|
|
>x : T
|
|
>T : T
|
|
>x : T
|
|
|
|
r = f; // should be allowed
|
|
>r = f : <T>(x: T) => T
|
|
>r : <T>(x: T) => T
|
|
>f : <T>(x: T) => T
|
|
|