24 lines
1.4 KiB
Text
24 lines
1.4 KiB
Text
=== tests/cases/compiler/genericFunctionSpecializations1.ts ===
|
|
function foo3<T>(test: string); // error
|
|
>foo3 : Symbol(foo3, Decl(genericFunctionSpecializations1.ts, 0, 0), Decl(genericFunctionSpecializations1.ts, 0, 31))
|
|
>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 0, 14))
|
|
>test : Symbol(test, Decl(genericFunctionSpecializations1.ts, 0, 17))
|
|
|
|
function foo3<T>(test: T) { }
|
|
>foo3 : Symbol(foo3, Decl(genericFunctionSpecializations1.ts, 0, 0), Decl(genericFunctionSpecializations1.ts, 0, 31))
|
|
>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 1, 14))
|
|
>test : Symbol(test, Decl(genericFunctionSpecializations1.ts, 1, 17))
|
|
>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 1, 14))
|
|
|
|
function foo4<T>(test: string); // valid
|
|
>foo4 : Symbol(foo4, Decl(genericFunctionSpecializations1.ts, 1, 29), Decl(genericFunctionSpecializations1.ts, 3, 31))
|
|
>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 3, 14))
|
|
>test : Symbol(test, Decl(genericFunctionSpecializations1.ts, 3, 17))
|
|
|
|
function foo4<T extends String>(test: T) { }
|
|
>foo4 : Symbol(foo4, Decl(genericFunctionSpecializations1.ts, 1, 29), Decl(genericFunctionSpecializations1.ts, 3, 31))
|
|
>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 4, 14))
|
|
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11))
|
|
>test : Symbol(test, Decl(genericFunctionSpecializations1.ts, 4, 32))
|
|
>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 4, 14))
|
|
|