File tree 2 files changed +21
-17
lines changed
2 files changed +21
-17
lines changed Original file line number Diff line number Diff line change @@ -12114,7 +12114,7 @@ module ts {
12114
12114
12115
12115
if (parameter.type.kind === SyntaxKind.TypeReference) {
12116
12116
var type = getTypeFromTypeReference(<TypeReferenceNode>(parameter.type));
12117
- if (type.flags & TypeFlags.NumberLike) {
12117
+ if (( type.flags & TypeFlags.NumberLike) || (type.flags & TypeFlags.String) ) {
12118
12118
return type;
12119
12119
}
12120
12120
}
Original file line number Diff line number Diff line change @@ -6,31 +6,30 @@ var ps: IPropertySet = null;
6
6
var index : any = "hello" ;
7
7
ps [ index ] = 12 ;
8
8
9
- enum Val {
9
+ enum Values {
10
10
a = 1 ,
11
11
b = 2
12
12
}
13
13
14
- type Val2 = Val ;
15
- type Val3 = number ;
14
+ type Values2 = Values ;
15
+ type Values3 = number ;
16
16
17
- interface IEnum {
18
- [ index : Val ] : Val ;
17
+ interface EnumMap {
18
+ [ index : Values ] : Values ;
19
19
}
20
20
21
-
22
- interface IEnum2 {
23
- [ index : Val2 ] : Val2 ;
21
+ interface EnumMap2 {
22
+ [ index : Values2 ] : Values2 ;
24
23
}
25
- interface IEnum3 {
26
- [ index : Val3 ] : Val3 ;
24
+ interface NumberMap {
25
+ [ index : Values3 ] : Values3 ;
27
26
}
28
27
29
- var pe : IEnum = null ;
28
+ var pe : Values = null ;
30
29
31
30
pe [ 1 ] = null
32
31
pe [ 3 ] = null
33
- pe [ Val . b ] = 5
32
+ pe [ Values . b ] = 5
34
33
35
34
pe [ true ] = null
36
35
@@ -47,13 +46,13 @@ enum E {
47
46
48
47
49
48
interface DuplicateAccess {
50
- [ index : Val ] : Val ;
51
- [ index : Val2 ] : Val2 ;
49
+ [ index : Values ] : Values ;
50
+ [ index : Values2 ] : Values2 ;
52
51
}
53
52
54
53
interface DuplicateAccess2 {
55
- [ index : number ] : Val ;
56
- [ index : Val3 ] : Val3 ;
54
+ [ index : number ] : Values ;
55
+ [ index : Values3 ] : Values3 ;
57
56
}
58
57
59
58
var x : { [ x : string ] : string }
72
71
z = y ;
73
72
z = z ;
74
73
74
+
75
+ type foo = string
76
+ var s : { [ x : foo ] : string }
77
+ x = s
78
+ s = x
You can’t perform that action at this time.
0 commit comments