File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
tests/cases/conformance/types/nonPrimitive Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
- function generic < T > ( t : T ) { }
1
+ function generic < T > ( t : T ) {
2
+ var o : object = t ; // expect error
3
+ }
2
4
var a = { } ;
3
5
var b = "42" ;
4
6
@@ -7,7 +9,9 @@ generic<object>(a);
7
9
generic < object > ( 123 ) ; // expect error
8
10
generic < object > ( b ) ; // expect error
9
11
10
- function bound < T extends object > ( t : T ) { }
12
+ function bound < T extends object > ( t : T ) {
13
+ var o : object = t ; // ok
14
+ }
11
15
12
16
bound ( { } ) ;
13
17
bound ( a ) ;
@@ -21,6 +25,10 @@ bound2<Object>();
21
25
bound2 < number > ( ) ; // expect error
22
26
bound2 < string > ( ) ; // expect error
23
27
28
+ function bound3 < T extends { } > ( t : T ) {
29
+ var o : object = t ; // ok
30
+ }
31
+
24
32
interface Proxy < T extends object > { }
25
33
26
34
var x : Proxy < number > ; // error
@@ -29,7 +37,7 @@ var z: Proxy<undefined> ; // ok
29
37
30
38
31
39
interface Blah {
32
- foo : number ;
40
+ foo : number ;
33
41
}
34
42
35
43
var u : Proxy < Blah > ; // ok
You can’t perform that action at this time.
0 commit comments