Skip to content

Commit 74a048a

Browse files
new test, old tests
1 parent ddc7c3b commit 74a048a

11 files changed

+38
-31
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
1-
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'.
2-
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,22): error TS1005: '=' expected.
3-
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1109: Expression expected.
4-
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,5): error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'.
5-
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,22): error TS1005: '=' expected.
6-
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,32): error TS1109: Expression expected.
1+
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1005: '(' expected.
2+
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,32): error TS1005: '(' expected.
73

84

9-
==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts (6 errors) ====
5+
==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts (2 errors) ====
106
// array type cannot use typeof.
117

128
var x = 1;
139
var xs: typeof x[]; // Not an error. This is equivalent to Array<typeof x>
1410
var xs2: typeof Array;
1511
var xs3: typeof Array<number>;
16-
~~~
17-
!!! error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'.
18-
~
19-
!!! error TS1005: '=' expected.
2012
~
21-
!!! error TS1109: Expression expected.
13+
!!! error TS1005: '(' expected.
2214
var xs4: typeof Array<typeof x>;
23-
~~~
24-
!!! error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'.
25-
~
26-
!!! error TS1005: '=' expected.
2715
~
28-
!!! error TS1109: Expression expected.
16+
!!! error TS1005: '(' expected.

tests/baselines/reference/arrayTypeOfTypeOf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ var xs4: typeof Array<typeof x>;
1212
var x = 1;
1313
var xs; // Not an error. This is equivalent to Array<typeof x>
1414
var xs2;
15-
var xs3 = ;
16-
var xs4 = ;
15+
var xs3;
16+
var xs4;

tests/baselines/reference/invalidTypeOfTarget.errors.txt

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(1,16): error TS1003: Identifier expected.
22
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(2,16): error TS1003: Identifier expected.
3-
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(2,24): error TS1005: '=>' expected.
3+
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(2,18): error TS1005: ',' expected.
4+
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(2,20): error TS1134: Variable declaration expected.
5+
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(2,24): error TS1109: Expression expected.
46
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(3,16): error TS1003: Identifier expected.
57
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(4,16): error TS1003: Identifier expected.
68
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(5,16): error TS1003: Identifier expected.
@@ -12,15 +14,19 @@ tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts
1214
tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts(8,16): error TS1003: Identifier expected.
1315

1416

15-
==== tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts (12 errors) ====
17+
==== tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts (14 errors) ====
1618
var x1: typeof {};
1719
~
1820
!!! error TS1003: Identifier expected.
1921
var x2: typeof (): void;
2022
~
2123
!!! error TS1003: Identifier expected.
24+
~
25+
!!! error TS1005: ',' expected.
26+
~~~~
27+
!!! error TS1134: Variable declaration expected.
2228
~
23-
!!! error TS1005: '=>' expected.
29+
!!! error TS1109: Expression expected.
2430
var x3: typeof 1;
2531
~
2632
!!! error TS1003: Identifier expected.

tests/baselines/reference/invalidTypeOfTarget.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ var x8: typeof /123/;
1010

1111
//// [invalidTypeOfTarget.js]
1212
var x1 = {};
13-
var x2 = function () { return ; };
13+
var x2;
14+
void ;
1415
var x3 = 1;
1516
var x4 = '';
1617
var x5;
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType5.ts(2,7): error TS2304: Cannot find name 'B'.
2+
tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType5.ts(3,5): error TS2304: Cannot find name 'T'.
23
tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType5.ts(3,7): error TS1005: '(' expected.
34

45

5-
==== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType5.ts (2 errors) ====
6+
==== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType5.ts (3 errors) ====
67
var v: {
78
A: B
89
~
910
!!! error TS2304: Cannot find name 'B'.
1011
<T>;
12+
~
13+
!!! error TS2304: Cannot find name 'T'.
1114
~
1215
!!! error TS1005: '(' expected.
1316
};
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts(1,15): error TS2304: Cannot find name 'A'.
2-
tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts(1,16): error TS1005: '=' expected.
32
tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts(1,17): error TS2304: Cannot find name 'B'.
4-
tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts(1,19): error TS1109: Expression expected.
3+
tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts(1,19): error TS1005: '(' expected.
54

65

7-
==== tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts (4 errors) ====
6+
==== tests/cases/conformance/parser/ecmascript5/Types/parserTypeQuery8.ts (3 errors) ====
87
var v: typeof A<B>
98
~
109
!!! error TS2304: Cannot find name 'A'.
11-
~
12-
!!! error TS1005: '=' expected.
1310
~
1411
!!! error TS2304: Cannot find name 'B'.
1512

16-
!!! error TS1109: Expression expected.
13+
!!! error TS1005: '(' expected.

tests/baselines/reference/parserTypeQuery8.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
var v: typeof A<B>
33

44
//// [parserTypeQuery8.js]
5-
var v = ;
5+
var v;

tests/baselines/reference/typeCall.js

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ type i = Wrap<123>;
2828

2929
type F5 = () => () => { a: () => 1; };
3030
type j = F5()()['a']();
31+
32+
type k = Id<string>('foo');
3133

3234

3335
//// [typeCall.js]

tests/baselines/reference/typeCall.symbols

+4
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,7 @@ type j = F5()()['a']();
8080
>j : Symbol(j, Decl(typeCall.ts, 27, 38))
8181
>F5 : Symbol(F5, Decl(typeCall.ts, 25, 19))
8282

83+
type k = Id<string>('foo');
84+
>k : Symbol(k, Decl(typeCall.ts, 28, 23))
85+
>Id : Symbol(Id, Decl(typeCall.ts, 19, 21))
86+

tests/baselines/reference/typeCall.types

+4
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,7 @@ type j = F5()()['a']();
8181
>j : 1
8282
>F5 : F5
8383

84+
type k = Id<string>('foo');
85+
>k : any
86+
>Id : Id
87+

tests/cases/compiler/typeCall.ts

+2
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ type i = Wrap<123>;
2929

3030
type F5 = () => () => { a: () => 1; };
3131
type j = F5()()['a']();
32+
33+
type k = Id<string>('foo');

0 commit comments

Comments
 (0)