Skip to content

Commit bf471c2

Browse files
fix typo
1 parent c76b8b1 commit bf471c2

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(3,1): error TS2322: Type 'Object' is not assignable to type 'RegExp'.
2+
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
3+
Property 'exec' is missing in type 'Object'.
4+
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,5): error TS2322: Type 'Object' is not assignable to type 'String'.
5+
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
6+
Property 'charAt' is missing in type 'Object'.
7+
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,5): error TS2322: Type 'Number' is not assignable to type 'String'.
8+
Property 'charAt' is missing in type 'Number'.
9+
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2322: Type 'Object' is not assignable to type 'Error'.
10+
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
11+
Property 'name' is missing in type 'Object'.
12+
13+
14+
==== tests/cases/compiler/assigningFromObjectToAnythingElse.ts (4 errors) ====
15+
var x: Object;
16+
var y: RegExp;
17+
y = x;
18+
~
19+
!!! error TS2322: Type 'Object' is not assignable to type 'RegExp'.
20+
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
21+
!!! error TS2322: Property 'exec' is missing in type 'Object'.
22+
23+
var a: String = Object.create<Object>("");
24+
~
25+
!!! error TS2322: Type 'Object' is not assignable to type 'String'.
26+
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
27+
!!! error TS2322: Property 'charAt' is missing in type 'Object'.
28+
var c: String = Object.create<Number>(1);
29+
~
30+
!!! error TS2322: Type 'Number' is not assignable to type 'String'.
31+
!!! error TS2322: Property 'charAt' is missing in type 'Number'.
32+
33+
var w: Error = new Object();
34+
~
35+
!!! error TS2322: Type 'Object' is not assignable to type 'Error'.
36+
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
37+
!!! error TS2322: Property 'name' is missing in type 'Object'.
38+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//// [assigningFromObjectToAnythingElse.ts]
2+
var x: Object;
3+
var y: RegExp;
4+
y = x;
5+
6+
var a: String = Object.create<Object>("");
7+
var c: String = Object.create<Number>(1);
8+
9+
var w: Error = new Object();
10+
11+
12+
//// [assigningFromObjectToAnythingElse.js]
13+
var x;
14+
var y;
15+
y = x;
16+
var a = Object.create("");
17+
var c = Object.create(1);
18+
var w = new Object();

0 commit comments

Comments
 (0)