mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Merge pull request #10961 from YuichiNukiyama/change_errormessage
change error message for assigning from object
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(3,1): error TS2322: Type 'Object' is not assignable to type 'RegExp'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Property 'exec' is missing in type 'Object'.
|
||||
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,5): error TS2322: Type 'Object' is not assignable to type 'String'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Property 'charAt' is missing in type 'Object'.
|
||||
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,5): error TS2322: Type 'Number' is not assignable to type 'String'.
|
||||
Property 'charAt' is missing in type 'Number'.
|
||||
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2322: Type 'Object' is not assignable to type 'Error'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Property 'name' is missing in type 'Object'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assigningFromObjectToAnythingElse.ts (4 errors) ====
|
||||
var x: Object;
|
||||
var y: RegExp;
|
||||
y = x;
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'RegExp'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Property 'exec' is missing in type 'Object'.
|
||||
|
||||
var a: String = Object.create<Object>("");
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'String'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Property 'charAt' is missing in type 'Object'.
|
||||
var c: String = Object.create<Number>(1);
|
||||
~
|
||||
!!! error TS2322: Type 'Number' is not assignable to type 'String'.
|
||||
!!! error TS2322: Property 'charAt' is missing in type 'Number'.
|
||||
|
||||
var w: Error = new Object();
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'Error'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Property 'name' is missing in type 'Object'.
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
//// [assigningFromObjectToAnythingElse.ts]
|
||||
var x: Object;
|
||||
var y: RegExp;
|
||||
y = x;
|
||||
|
||||
var a: String = Object.create<Object>("");
|
||||
var c: String = Object.create<Number>(1);
|
||||
|
||||
var w: Error = new Object();
|
||||
|
||||
|
||||
//// [assigningFromObjectToAnythingElse.js]
|
||||
var x;
|
||||
var y;
|
||||
y = x;
|
||||
var a = Object.create("");
|
||||
var c = Object.create(1);
|
||||
var w = new Object();
|
||||
@@ -2,7 +2,8 @@ tests/cases/compiler/intTypeCheck.ts(35,6): error TS2304: Cannot find name 'p'.
|
||||
tests/cases/compiler/intTypeCheck.ts(71,6): error TS2304: Cannot find name 'p'.
|
||||
tests/cases/compiler/intTypeCheck.ts(85,5): error TS2386: Overload signatures must all be optional or required.
|
||||
tests/cases/compiler/intTypeCheck.ts(99,5): error TS2322: Type 'Object' is not assignable to type 'i1'.
|
||||
Property 'p' is missing in type 'Object'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Property 'p' is missing in type 'Object'.
|
||||
tests/cases/compiler/intTypeCheck.ts(100,16): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
tests/cases/compiler/intTypeCheck.ts(101,5): error TS2322: Type 'Base' is not assignable to type 'i1'.
|
||||
Property 'p' is missing in type 'Base'.
|
||||
@@ -15,7 +16,8 @@ tests/cases/compiler/intTypeCheck.ts(107,17): error TS2351: Cannot use 'new' wit
|
||||
tests/cases/compiler/intTypeCheck.ts(112,5): error TS2322: Type '{}' is not assignable to type 'i2'.
|
||||
Type '{}' provides no match for the signature '(): any'
|
||||
tests/cases/compiler/intTypeCheck.ts(113,5): error TS2322: Type 'Object' is not assignable to type 'i2'.
|
||||
Type 'Object' provides no match for the signature '(): any'
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Type 'Object' provides no match for the signature '(): any'
|
||||
tests/cases/compiler/intTypeCheck.ts(114,17): error TS2350: Only a void function can be called with the 'new' keyword.
|
||||
tests/cases/compiler/intTypeCheck.ts(115,5): error TS2322: Type 'Base' is not assignable to type 'i2'.
|
||||
Type 'Base' provides no match for the signature '(): any'
|
||||
@@ -26,7 +28,8 @@ tests/cases/compiler/intTypeCheck.ts(121,17): error TS2351: Cannot use 'new' wit
|
||||
tests/cases/compiler/intTypeCheck.ts(126,5): error TS2322: Type '{}' is not assignable to type 'i3'.
|
||||
Type '{}' provides no match for the signature 'new (): any'
|
||||
tests/cases/compiler/intTypeCheck.ts(127,5): error TS2322: Type 'Object' is not assignable to type 'i3'.
|
||||
Type 'Object' provides no match for the signature 'new (): any'
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Type 'Object' provides no match for the signature 'new (): any'
|
||||
tests/cases/compiler/intTypeCheck.ts(129,5): error TS2322: Type 'Base' is not assignable to type 'i3'.
|
||||
Type 'Base' provides no match for the signature 'new (): any'
|
||||
tests/cases/compiler/intTypeCheck.ts(131,5): error TS2322: Type '() => void' is not assignable to type 'i3'.
|
||||
@@ -43,7 +46,8 @@ tests/cases/compiler/intTypeCheck.ts(149,17): error TS2351: Cannot use 'new' wit
|
||||
tests/cases/compiler/intTypeCheck.ts(154,5): error TS2322: Type '{}' is not assignable to type 'i5'.
|
||||
Property 'p' is missing in type '{}'.
|
||||
tests/cases/compiler/intTypeCheck.ts(155,5): error TS2322: Type 'Object' is not assignable to type 'i5'.
|
||||
Property 'p' is missing in type 'Object'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Property 'p' is missing in type 'Object'.
|
||||
tests/cases/compiler/intTypeCheck.ts(156,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
tests/cases/compiler/intTypeCheck.ts(157,5): error TS2322: Type 'Base' is not assignable to type 'i5'.
|
||||
Property 'p' is missing in type 'Base'.
|
||||
@@ -56,7 +60,8 @@ tests/cases/compiler/intTypeCheck.ts(163,17): error TS2351: Cannot use 'new' wit
|
||||
tests/cases/compiler/intTypeCheck.ts(168,5): error TS2322: Type '{}' is not assignable to type 'i6'.
|
||||
Type '{}' provides no match for the signature '(): any'
|
||||
tests/cases/compiler/intTypeCheck.ts(169,5): error TS2322: Type 'Object' is not assignable to type 'i6'.
|
||||
Type 'Object' provides no match for the signature '(): any'
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Type 'Object' provides no match for the signature '(): any'
|
||||
tests/cases/compiler/intTypeCheck.ts(170,17): error TS2350: Only a void function can be called with the 'new' keyword.
|
||||
tests/cases/compiler/intTypeCheck.ts(171,5): error TS2322: Type 'Base' is not assignable to type 'i6'.
|
||||
Type 'Base' provides no match for the signature '(): any'
|
||||
@@ -69,7 +74,8 @@ tests/cases/compiler/intTypeCheck.ts(177,17): error TS2351: Cannot use 'new' wit
|
||||
tests/cases/compiler/intTypeCheck.ts(182,5): error TS2322: Type '{}' is not assignable to type 'i7'.
|
||||
Type '{}' provides no match for the signature 'new (): any'
|
||||
tests/cases/compiler/intTypeCheck.ts(183,5): error TS2322: Type 'Object' is not assignable to type 'i7'.
|
||||
Type 'Object' provides no match for the signature 'new (): any'
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Type 'Object' provides no match for the signature 'new (): any'
|
||||
tests/cases/compiler/intTypeCheck.ts(185,17): error TS2352: Type 'Base' cannot be converted to type 'i7'.
|
||||
Type 'Base' provides no match for the signature 'new (): any'
|
||||
tests/cases/compiler/intTypeCheck.ts(187,5): error TS2322: Type '() => void' is not assignable to type 'i7'.
|
||||
@@ -193,7 +199,8 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
|
||||
var obj2: i1 = new Object();
|
||||
~~~~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'i1'.
|
||||
!!! error TS2322: Property 'p' is missing in type 'Object'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Property 'p' is missing in type 'Object'.
|
||||
var obj3: i1 = new obj0;
|
||||
~~~~~~~~
|
||||
!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
@@ -229,7 +236,8 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
|
||||
var obj13: i2 = new Object();
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'i2'.
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature '(): any'
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature '(): any'
|
||||
var obj14: i2 = new obj11;
|
||||
~~~~~~~~~
|
||||
!!! error TS2350: Only a void function can be called with the 'new' keyword.
|
||||
@@ -262,7 +270,8 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
|
||||
var obj24: i3 = new Object();
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'i3'.
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature 'new (): any'
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature 'new (): any'
|
||||
var obj25: i3 = new obj22;
|
||||
var obj26: i3 = new Base;
|
||||
~~~~~
|
||||
@@ -320,7 +329,8 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
|
||||
var obj46: i5 = new Object();
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'i5'.
|
||||
!!! error TS2322: Property 'p' is missing in type 'Object'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Property 'p' is missing in type 'Object'.
|
||||
var obj47: i5 = new obj44;
|
||||
~~~~~~~~~
|
||||
!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
@@ -356,7 +366,8 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
|
||||
var obj57: i6 = new Object();
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'i6'.
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature '(): any'
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature '(): any'
|
||||
var obj58: i6 = new obj55;
|
||||
~~~~~~~~~
|
||||
!!! error TS2350: Only a void function can be called with the 'new' keyword.
|
||||
@@ -392,7 +403,8 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
|
||||
var obj68: i7 = new Object();
|
||||
~~~~~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'i7'.
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature 'new (): any'
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature 'new (): any'
|
||||
var obj69: i7 = new obj66;
|
||||
var obj70: i7 = <i7>new Base;
|
||||
~~~~~~~~~~~~
|
||||
|
||||
@@ -3,17 +3,19 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC
|
||||
Type '() => number' is not assignable to type '() => string'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'.
|
||||
Types of property 'toString' are incompatible.
|
||||
Type '() => string' is not assignable to type '() => number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Types of property 'toString' are incompatible.
|
||||
Type '() => string' is not assignable to type '() => number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object'.
|
||||
Types of property 'toString' are incompatible.
|
||||
Type '() => number' is not assignable to type '() => string'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(15,1): error TS2322: Type 'Object' is not assignable to type 'C'.
|
||||
Types of property 'toString' are incompatible.
|
||||
Type '() => string' is not assignable to type '() => number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Types of property 'toString' are incompatible.
|
||||
Type '() => string' is not assignable to type '() => number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'.
|
||||
Types of property 'toString' are incompatible.
|
||||
Type '() => void' is not assignable to type '() => string'.
|
||||
@@ -36,9 +38,10 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC
|
||||
i = o; // error
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'I'.
|
||||
!!! error TS2322: Types of property 'toString' are incompatible.
|
||||
!!! error TS2322: Type '() => string' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Types of property 'toString' are incompatible.
|
||||
!!! error TS2322: Type '() => string' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
|
||||
class C {
|
||||
toString(): number { return 1; }
|
||||
@@ -53,9 +56,10 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC
|
||||
c = o; // error
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'C'.
|
||||
!!! error TS2322: Types of property 'toString' are incompatible.
|
||||
!!! error TS2322: Type '() => string' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Types of property 'toString' are incompatible.
|
||||
!!! error TS2322: Type '() => string' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
|
||||
var a = {
|
||||
toString: () => { }
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'.
|
||||
Type 'Object' provides no match for the signature '(): void'
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Type 'Object' provides no match for the signature '(): void'
|
||||
tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type '() => void'.
|
||||
Type 'Object' provides no match for the signature '(): void'
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Type 'Object' provides no match for the signature '(): void'
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ====
|
||||
@@ -15,7 +17,8 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOf
|
||||
i = f;
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'I'.
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature '(): void'
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature '(): void'
|
||||
|
||||
var a: {
|
||||
(): void
|
||||
@@ -24,4 +27,5 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOf
|
||||
a = f;
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type '() => void'.
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature '(): void'
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature '(): void'
|
||||
@@ -1,7 +1,9 @@
|
||||
tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'.
|
||||
Type 'Object' provides no match for the signature 'new (): any'
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Type 'Object' provides no match for the signature 'new (): any'
|
||||
tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type 'new () => any'.
|
||||
Type 'Object' provides no match for the signature 'new (): any'
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Type 'Object' provides no match for the signature 'new (): any'
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ====
|
||||
@@ -15,7 +17,8 @@ tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMemb
|
||||
i = f;
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'I'.
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature 'new (): any'
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature 'new (): any'
|
||||
|
||||
var a: {
|
||||
new(): any
|
||||
@@ -24,4 +27,5 @@ tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMemb
|
||||
a = f;
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'new () => any'.
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature 'new (): any'
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature 'new (): any'
|
||||
@@ -1,7 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'.
|
||||
Type 'Object' provides no match for the signature '(): void'
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Type 'Object' provides no match for the signature '(): void'
|
||||
tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(14,1): error TS2322: Type 'Object' is not assignable to type '() => void'.
|
||||
Type 'Object' provides no match for the signature '(): void'
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
Type 'Object' provides no match for the signature '(): void'
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts (2 errors) ====
|
||||
@@ -15,7 +17,8 @@ tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAut
|
||||
i = o;
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'I'.
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature '(): void'
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature '(): void'
|
||||
|
||||
var a: {
|
||||
(): void
|
||||
@@ -24,5 +27,6 @@ tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAut
|
||||
a = o;
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type '() => void'.
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature '(): void'
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: Type 'Object' provides no match for the signature '(): void'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual.ts(5,5): error TS2322: Type 'Object' is not assignable to type 'T'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
|
||||
|
||||
==== tests/cases/compiler/typeParametersShouldNotBeEqual.ts (2 errors) ====
|
||||
@@ -12,6 +13,7 @@ tests/cases/compiler/typeParametersShouldNotBeEqual.ts(5,5): error TS2322: Type
|
||||
x = z; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'T'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
z = x; // Ok
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(7,5): error TS2322: Type
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(8,5): error TS2322: Type 'U' is not assignable to type 'V'.
|
||||
Type 'Date' is not assignable to type 'V'.
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(9,5): error TS2322: Type 'Object' is not assignable to type 'T'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
|
||||
|
||||
==== tests/cases/compiler/typeParametersShouldNotBeEqual2.ts (6 errors) ====
|
||||
@@ -34,6 +35,7 @@ tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(9,5): error TS2322: Type
|
||||
x = zz; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'T'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
zz = x; // Ok
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
Type 'Object' is not assignable to type 'T'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(5,5): error TS2322: Type 'Object' is not assignable to type 'T'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
|
||||
|
||||
==== tests/cases/compiler/typeParametersShouldNotBeEqual3.ts (2 errors) ====
|
||||
@@ -11,9 +13,11 @@ tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(5,5): error TS2322: Type
|
||||
~
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'T'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
x = z; // Ok
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'T'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
z = x; // Ok
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
var x: Object;
|
||||
var y: RegExp;
|
||||
y = x;
|
||||
|
||||
var a: String = Object.create<Object>("");
|
||||
var c: String = Object.create<Number>(1);
|
||||
|
||||
var w: Error = new Object();
|
||||
Reference in New Issue
Block a user