Add test for bug #807
This commit is contained in:
parent
47bded060e
commit
25171857c5
8
tests/baselines/reference/overloadsWithConstraints.js
Normal file
8
tests/baselines/reference/overloadsWithConstraints.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
//// [overloadsWithConstraints.ts]
|
||||
declare function f<T extends Number>(x: T): T;
|
||||
declare function f<T extends String>(x: T): T
|
||||
|
||||
var v = f<string>("");
|
||||
|
||||
//// [overloadsWithConstraints.js]
|
||||
var v = f("");
|
22
tests/baselines/reference/overloadsWithConstraints.types
Normal file
22
tests/baselines/reference/overloadsWithConstraints.types
Normal file
|
@ -0,0 +1,22 @@
|
|||
=== tests/cases/compiler/overloadsWithConstraints.ts ===
|
||||
declare function f<T extends Number>(x: T): T;
|
||||
>f : { <T extends Number>(x: T): T; <T extends String>(x: T): T; }
|
||||
>T : T
|
||||
>Number : Number
|
||||
>x : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
declare function f<T extends String>(x: T): T
|
||||
>f : { <T extends Number>(x: T): T; <T extends String>(x: T): T; }
|
||||
>T : T
|
||||
>String : String
|
||||
>x : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
var v = f<string>("");
|
||||
>v : string
|
||||
>f<string>("") : string
|
||||
>f : { <T extends Number>(x: T): T; <T extends String>(x: T): T; }
|
||||
|
4
tests/cases/compiler/overloadsWithConstraints.ts
Normal file
4
tests/cases/compiler/overloadsWithConstraints.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
declare function f<T extends Number>(x: T): T;
|
||||
declare function f<T extends String>(x: T): T
|
||||
|
||||
var v = f<string>("");
|
Loading…
Reference in a new issue