2014-10-23 21:27:34 +02:00
|
|
|
=== tests/cases/compiler/overloadsWithConstraints.ts ===
|
|
|
|
declare function f<T extends Number>(x: T): T;
|
2015-04-13 22:54:22 +02:00
|
|
|
>f : { <T extends Number>(x: T): T; <T extends String>(x: T): T; }, Symbol(f,Decl(overloadsWithConstraints.ts,0,0),Decl(overloadsWithConstraints.ts,0,46))
|
|
|
|
>T : T, Symbol(T,Decl(overloadsWithConstraints.ts,0,19))
|
|
|
|
>Number : Number, Symbol(Number,Decl(lib.d.ts,456,40),Decl(lib.d.ts,518,11))
|
|
|
|
>x : T, Symbol(x,Decl(overloadsWithConstraints.ts,0,37))
|
|
|
|
>T : T, Symbol(T,Decl(overloadsWithConstraints.ts,0,19))
|
|
|
|
>T : T, Symbol(T,Decl(overloadsWithConstraints.ts,0,19))
|
2014-10-23 21:27:34 +02:00
|
|
|
|
|
|
|
declare function f<T extends String>(x: T): T
|
2015-04-13 22:54:22 +02:00
|
|
|
>f : { <T extends Number>(x: T): T; <T extends String>(x: T): T; }, Symbol(f,Decl(overloadsWithConstraints.ts,0,0),Decl(overloadsWithConstraints.ts,0,46))
|
|
|
|
>T : T, Symbol(T,Decl(overloadsWithConstraints.ts,1,19))
|
|
|
|
>String : String, Symbol(String,Decl(lib.d.ts,275,1),Decl(lib.d.ts,443,11))
|
|
|
|
>x : T, Symbol(x,Decl(overloadsWithConstraints.ts,1,37))
|
|
|
|
>T : T, Symbol(T,Decl(overloadsWithConstraints.ts,1,19))
|
|
|
|
>T : T, Symbol(T,Decl(overloadsWithConstraints.ts,1,19))
|
2014-10-23 21:27:34 +02:00
|
|
|
|
|
|
|
var v = f<string>("");
|
2015-04-13 22:54:22 +02:00
|
|
|
>v : string, Symbol(v,Decl(overloadsWithConstraints.ts,3,3))
|
2014-10-23 21:27:34 +02:00
|
|
|
>f<string>("") : string
|
2015-04-13 22:54:22 +02:00
|
|
|
>f : { <T extends Number>(x: T): T; <T extends String>(x: T): T; }, Symbol(f,Decl(overloadsWithConstraints.ts,0,0),Decl(overloadsWithConstraints.ts,0,46))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2014-10-23 21:27:34 +02:00
|
|
|
|