|
1 | | -tests/cases/compiler/instanceofOperator.ts(6,7): error TS2300: Duplicate identifier 'Object'. |
2 | | -tests/cases/compiler/instanceofOperator.ts(11,1): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. |
3 | | -tests/cases/compiler/instanceofOperator.ts(14,16): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. |
4 | | -tests/cases/compiler/instanceofOperator.ts(15,19): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. |
5 | | -tests/cases/compiler/instanceofOperator.ts(18,1): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. |
6 | | -tests/cases/compiler/instanceofOperator.ts(20,1): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. |
| 1 | +tests/cases/compiler/instanceofOperator.ts(12,5): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. |
| 2 | +tests/cases/compiler/instanceofOperator.ts(15,20): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. |
| 3 | +tests/cases/compiler/instanceofOperator.ts(16,23): error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. |
| 4 | +tests/cases/compiler/instanceofOperator.ts(19,5): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. |
| 5 | +tests/cases/compiler/instanceofOperator.ts(21,5): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. |
7 | 6 |
|
8 | 7 |
|
9 | | -==== tests/cases/compiler/instanceofOperator.ts (6 errors) ==== |
| 8 | +==== tests/cases/compiler/instanceofOperator.ts (5 errors) ==== |
10 | 9 | // Spec: |
11 | 10 | // The instanceof operator requires the left operand to be of type Any or an object type, and the right |
12 | 11 | // operand to be of type Any or a subtype of the ‘Function’ interface type. The result is always of the |
13 | 12 | // Boolean primitive type. |
14 | 13 |
|
15 | | - class Object { } |
16 | | - ~~~~~~ |
17 | | -!!! error TS2300: Duplicate identifier 'Object'. |
18 | | - var obj: Object; |
| 14 | + module test { |
| 15 | + class Object { } |
| 16 | + var obj: Object; |
19 | 17 |
|
20 | 18 |
|
21 | 19 |
|
22 | | - 4 instanceof null; |
23 | | - ~ |
| 20 | + 4 instanceof null; |
| 21 | + ~ |
24 | 22 | !!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. |
25 | 23 |
|
26 | | - // Error and should be error |
27 | | - obj instanceof 4; |
28 | | - ~ |
| 24 | + // Error and should be error |
| 25 | + obj instanceof 4; |
| 26 | + ~ |
29 | 27 | !!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. |
30 | | - Object instanceof obj; |
31 | | - ~~~ |
| 28 | + Object instanceof obj; |
| 29 | + ~~~ |
32 | 30 | !!! error TS2359: The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. |
33 | 31 |
|
34 | | - // Error on left hand side |
35 | | - null instanceof null; |
36 | | - ~~~~ |
| 32 | + // Error on left hand side |
| 33 | + null instanceof null; |
| 34 | + ~~~~ |
37 | 35 | !!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. |
38 | | - obj instanceof Object; |
39 | | - undefined instanceof undefined; |
40 | | - ~~~~~~~~~ |
| 36 | + obj instanceof Object; |
| 37 | + undefined instanceof undefined; |
| 38 | + ~~~~~~~~~ |
41 | 39 | !!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. |
| 40 | + } |
42 | 41 |
|
43 | 42 |
|
0 commit comments