diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt index 384c338d9c7..0d7fe1071e9 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt @@ -1,18 +1,12 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(33,5): error TS2322: Type 'D' is not assignable to type 'C'. - Weak type 'C' has no properties in common with 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(34,5): error TS2322: Type 'E' is not assignable to type 'C'. - Weak type 'C' has no properties in common with 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(35,5): error TS2322: Type 'F' is not assignable to type 'C'. - Weak type 'C' has no properties in common with 'F'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(36,5): error TS2322: Type 'D' is not assignable to type '{ opt?: Base; }'. - Weak type '{ opt?: Base; }' has no properties in common with 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(37,5): error TS2322: Type 'E' is not assignable to type '{ opt?: Base; }'. - Weak type '{ opt?: Base; }' has no properties in common with 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(38,5): error TS2322: Type 'F' is not assignable to type '{ opt?: Base; }'. - Weak type '{ opt?: Base; }' has no properties in common with 'F'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(39,5): error TS2322: Type 'D' is not assignable to type '{ opt?: Base; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(40,5): error TS2322: Type 'E' is not assignable to type '{ opt?: Base; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(41,5): error TS2322: Type 'F' is not assignable to type '{ opt?: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(33,5): error TS2559: Type 'D' has no properties in common with type 'C'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(34,5): error TS2559: Type 'E' has no properties in common with type 'C'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(35,5): error TS2559: Type 'F' has no properties in common with type 'C'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(36,5): error TS2559: Type 'D' has no properties in common with type '{ opt?: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(37,5): error TS2559: Type 'E' has no properties in common with type '{ opt?: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(38,5): error TS2559: Type 'F' has no properties in common with type '{ opt?: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(39,5): error TS2559: Type 'D' has no properties in common with type '{ opt?: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(40,5): error TS2559: Type 'E' has no properties in common with type '{ opt?: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(41,5): error TS2559: Type 'F' has no properties in common with type '{ opt?: Base; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2322: Type 'D' is not assignable to type 'C'. Property 'opt' is missing in type 'D'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2322: Type 'E' is not assignable to type 'C'. @@ -68,37 +62,31 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // disallowed by weak type checking c = d; ~ -!!! error TS2322: Type 'D' is not assignable to type 'C'. -!!! error TS2322: Weak type 'C' has no properties in common with 'D'. +!!! error TS2559: Type 'D' has no properties in common with type 'C'. c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C'. -!!! error TS2322: Weak type 'C' has no properties in common with 'E'. +!!! error TS2559: Type 'E' has no properties in common with type 'C'. c = f; ~ -!!! error TS2322: Type 'F' is not assignable to type 'C'. -!!! error TS2322: Weak type 'C' has no properties in common with 'F'. +!!! error TS2559: Type 'F' has no properties in common with type 'C'. a = d; ~ -!!! error TS2322: Type 'D' is not assignable to type '{ opt?: Base; }'. -!!! error TS2322: Weak type '{ opt?: Base; }' has no properties in common with 'D'. +!!! error TS2559: Type 'D' has no properties in common with type '{ opt?: Base; }'. a = e; ~ -!!! error TS2322: Type 'E' is not assignable to type '{ opt?: Base; }'. -!!! error TS2322: Weak type '{ opt?: Base; }' has no properties in common with 'E'. +!!! error TS2559: Type 'E' has no properties in common with type '{ opt?: Base; }'. a = f; ~ -!!! error TS2322: Type 'F' is not assignable to type '{ opt?: Base; }'. -!!! error TS2322: Weak type '{ opt?: Base; }' has no properties in common with 'F'. +!!! error TS2559: Type 'F' has no properties in common with type '{ opt?: Base; }'. b = d; ~ -!!! error TS2322: Type 'D' is not assignable to type '{ opt?: Base; }'. +!!! error TS2559: Type 'D' has no properties in common with type '{ opt?: Base; }'. b = e; ~ -!!! error TS2322: Type 'E' is not assignable to type '{ opt?: Base; }'. +!!! error TS2559: Type 'E' has no properties in common with type '{ opt?: Base; }'. b = f; ~ -!!! error TS2322: Type 'F' is not assignable to type '{ opt?: Base; }'. +!!! error TS2559: Type 'F' has no properties in common with type '{ opt?: Base; }'. // ok c = a; diff --git a/tests/baselines/reference/generatorTypeCheck63.errors.txt b/tests/baselines/reference/generatorTypeCheck63.errors.txt index bef6a0bfff3..ed2ed36a438 100644 --- a/tests/baselines/reference/generatorTypeCheck63.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck63.errors.txt @@ -1,12 +1,11 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(24,61): error TS2345: Argument of type '(state: State) => IterableIterator' is not assignable to parameter of type '(a: StrategicState) => IterableIterator'. - Type 'IterableIterator' is not assignable to type 'IterableIterator'. - Type 'State | 1' is not assignable to type 'StrategicState'. - Type '1' is not assignable to type 'StrategicState'. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(24,14): error TS2322: Type '(a: State | 1) => IterableIterator' is not assignable to type 'Strategy'. + Type 'IterableIterator' is not assignable to type 'IterableIterator'. + Type 'State | 1' is not assignable to type 'State'. + Type '1' is not assignable to type 'State'. tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(29,70): error TS7025: Generator implicitly has type 'IterableIterator' because it does not yield any values. Consider supplying a return type. tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(32,42): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'State' is not a valid type argument because it is not a supertype of candidate '1'. -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(36,62): error TS2345: Argument of type '(state: State) => IterableIterator' is not assignable to parameter of type '(a: StrategicState) => IterableIterator'. - Type 'IterableIterator' is not assignable to type 'IterableIterator'. +tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(36,14): error TS2322: Type '(a: State | 1) => IterableIterator' is not assignable to type 'Strategy'. ==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts (4 errors) ==== @@ -34,11 +33,11 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(36,62): err } export const Nothing: Strategy = strategy("Nothing", function* (state: State) { - ~~~~~~~~ -!!! error TS2345: Argument of type '(state: State) => IterableIterator' is not assignable to parameter of type '(a: StrategicState) => IterableIterator'. -!!! error TS2345: Type 'IterableIterator' is not assignable to type 'IterableIterator'. -!!! error TS2345: Type 'State | 1' is not assignable to type 'StrategicState'. -!!! error TS2345: Type '1' is not assignable to type 'StrategicState'. + ~~~~~~~ +!!! error TS2322: Type '(a: State | 1) => IterableIterator' is not assignable to type 'Strategy'. +!!! error TS2322: Type 'IterableIterator' is not assignable to type 'IterableIterator'. +!!! error TS2322: Type 'State | 1' is not assignable to type 'State'. +!!! error TS2322: Type '1' is not assignable to type 'State'. yield 1; return state; }); @@ -56,9 +55,8 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts(36,62): err }); export const Nothing3: Strategy = strategy("Nothing", function* (state: State) { - ~~~~~~~~ -!!! error TS2345: Argument of type '(state: State) => IterableIterator' is not assignable to parameter of type '(a: StrategicState) => IterableIterator'. -!!! error TS2345: Type 'IterableIterator' is not assignable to type 'IterableIterator'. + ~~~~~~~~ +!!! error TS2322: Type '(a: State | 1) => IterableIterator' is not assignable to type 'Strategy'. yield state; return 1; }); \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt index 9cd78e1cf57..022f9138108 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt @@ -4,12 +4,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW Property '1' is missing in type 'B2'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(32,11): error TS2420: Class 'B3' incorrectly implements interface 'A3'. Property ''1'' is missing in type 'B3'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(43,11): error TS2420: Class 'B' incorrectly implements interface 'A'. - Weak type 'A' has no properties in common with 'B'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(51,11): error TS2420: Class 'B2' incorrectly implements interface 'A2'. - Weak type 'A2' has no properties in common with 'B2'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(59,11): error TS2420: Class 'B3' incorrectly implements interface 'A3'. - Weak type 'A3' has no properties in common with 'B3'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(43,11): error TS2559: Type 'B' has no properties in common with type 'A'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(51,11): error TS2559: Type 'B2' has no properties in common with type 'A2'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(59,11): error TS2559: Type 'B3' has no properties in common with type 'A3'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts (6 errors) ==== @@ -66,8 +63,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B implements A { ~ -!!! error TS2420: Class 'B' incorrectly implements interface 'A'. -!!! error TS2420: Weak type 'A' has no properties in common with 'B'. +!!! error TS2559: Type 'B' has no properties in common with type 'A'. fooo: Derived; // weak type error } @@ -77,8 +73,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 implements A2 { ~~ -!!! error TS2420: Class 'B2' incorrectly implements interface 'A2'. -!!! error TS2420: Weak type 'A2' has no properties in common with 'B2'. +!!! error TS2559: Type 'B2' has no properties in common with type 'A2'. 2: Derived; // weak type error } @@ -88,8 +83,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 implements A3 { ~~ -!!! error TS2420: Class 'B3' incorrectly implements interface 'A3'. -!!! error TS2420: Weak type 'A3' has no properties in common with 'B3'. +!!! error TS2559: Type 'B3' has no properties in common with type 'A3'. '1.0': Derived; // weak type error } } diff --git a/tests/baselines/reference/tsxAttributeResolution1.errors.txt b/tests/baselines/reference/tsxAttributeResolution1.errors.txt index 2fd16644f0b..a6fe4154dfe 100644 --- a/tests/baselines/reference/tsxAttributeResolution1.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution1.errors.txt @@ -1,15 +1,12 @@ tests/cases/conformance/jsx/file.tsx(23,8): error TS2322: Type '{ x: "0"; }' is not assignable to type 'Attribs1'. Types of property 'x' are incompatible. Type '"0"' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(24,8): error TS2322: Type '{ y: 0; }' is not assignable to type 'Attribs1'. - Weak type 'Attribs1' has no properties in common with '{ y: 0; }'. -tests/cases/conformance/jsx/file.tsx(25,8): error TS2322: Type '{ y: "foo"; }' is not assignable to type 'Attribs1'. - Weak type 'Attribs1' has no properties in common with '{ y: "foo"; }'. +tests/cases/conformance/jsx/file.tsx(24,8): error TS2559: Type '{ y: 0; }' has no properties in common with type 'Attribs1'. +tests/cases/conformance/jsx/file.tsx(25,8): error TS2559: Type '{ y: "foo"; }' has no properties in common with type 'Attribs1'. tests/cases/conformance/jsx/file.tsx(26,8): error TS2322: Type '{ x: "32"; }' is not assignable to type 'Attribs1'. Types of property 'x' are incompatible. Type '"32"' is not assignable to type 'number'. -tests/cases/conformance/jsx/file.tsx(27,8): error TS2322: Type '{ var: "10"; }' is not assignable to type 'Attribs1'. - Weak type 'Attribs1' has no properties in common with '{ var: "10"; }'. +tests/cases/conformance/jsx/file.tsx(27,8): error TS2559: Type '{ var: "10"; }' has no properties in common with type 'Attribs1'. tests/cases/conformance/jsx/file.tsx(29,1): error TS2322: Type '{}' is not assignable to type '{ reqd: string; }'. Property 'reqd' is missing in type '{}'. tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '{ reqd: 10; }' is not assignable to type '{ reqd: string; }'. @@ -47,12 +44,10 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '{ reqd: 10; }' i !!! error TS2322: Type '"0"' is not assignable to type 'number'. ; // Error, no property "y" ~~~~~ -!!! error TS2322: Type '{ y: 0; }' is not assignable to type 'Attribs1'. -!!! error TS2322: Weak type 'Attribs1' has no properties in common with '{ y: 0; }'. +!!! error TS2559: Type '{ y: 0; }' has no properties in common with type 'Attribs1'. ; // Error, no property "y" ~~~~~~~ -!!! error TS2322: Type '{ y: "foo"; }' is not assignable to type 'Attribs1'. -!!! error TS2322: Weak type 'Attribs1' has no properties in common with '{ y: "foo"; }'. +!!! error TS2559: Type '{ y: "foo"; }' has no properties in common with type 'Attribs1'. ; // Error, "32" is not number ~~~~~~ !!! error TS2322: Type '{ x: "32"; }' is not assignable to type 'Attribs1'. @@ -60,8 +55,7 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '{ reqd: 10; }' i !!! error TS2322: Type '"32"' is not assignable to type 'number'. ; // Error, no 'var' property ~~~~~~~~ -!!! error TS2322: Type '{ var: "10"; }' is not assignable to type 'Attribs1'. -!!! error TS2322: Weak type 'Attribs1' has no properties in common with '{ var: "10"; }'. +!!! error TS2559: Type '{ var: "10"; }' has no properties in common with type 'Attribs1'. ; // Error, missing reqd ~~~~~~~~~ diff --git a/tests/baselines/reference/tsxAttributeResolution11.errors.txt b/tests/baselines/reference/tsxAttributeResolution11.errors.txt index c35ec291e51..a8a62ae656a 100644 --- a/tests/baselines/reference/tsxAttributeResolution11.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution11.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(11,22): error TS2322: Type '{ bar: "world"; }' is not assignable to type 'IntrinsicAttributes & { ref?: string; }'. - Weak type 'IntrinsicAttributes & { ref?: string; }' has no properties in common with '{ bar: "world"; }'. +tests/cases/conformance/jsx/file.tsx(11,22): error TS2559: Type '{ bar: "world"; }' has no properties in common with type 'IntrinsicAttributes & { ref?: string; }'. ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ==== @@ -28,7 +27,6 @@ tests/cases/conformance/jsx/file.tsx(11,22): error TS2322: Type '{ bar: "world"; // Should be an OK var x = ; ~~~~~~~~~~~ -!!! error TS2322: Type '{ bar: "world"; }' is not assignable to type 'IntrinsicAttributes & { ref?: string; }'. -!!! error TS2322: Weak type 'IntrinsicAttributes & { ref?: string; }' has no properties in common with '{ bar: "world"; }'. +!!! error TS2559: Type '{ bar: "world"; }' has no properties in common with type 'IntrinsicAttributes & { ref?: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxAttributeResolution15.errors.txt b/tests/baselines/reference/tsxAttributeResolution15.errors.txt index f4f1a706ac5..07b54411aab 100644 --- a/tests/baselines/reference/tsxAttributeResolution15.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution15.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(11,21): error TS2322: Type '{ prop1: "hello"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. - Weak type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }' has no properties in common with '{ prop1: "hello"; }'. +tests/cases/conformance/jsx/file.tsx(11,21): error TS2559: Type '{ prop1: "hello"; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -15,8 +14,7 @@ tests/cases/conformance/jsx/file.tsx(11,21): error TS2322: Type '{ prop1: "hello // Error let a = ~~~~~~~~~~~~~ -!!! error TS2322: Type '{ prop1: "hello"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. -!!! error TS2322: Weak type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }' has no properties in common with '{ prop1: "hello"; }'. +!!! error TS2559: Type '{ prop1: "hello"; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. // OK let b = { this.textInput = input; }} /> diff --git a/tests/baselines/reference/tsxElementResolution11.errors.txt b/tests/baselines/reference/tsxElementResolution11.errors.txt index 54eabef7aed..24ff907f0e0 100644 --- a/tests/baselines/reference/tsxElementResolution11.errors.txt +++ b/tests/baselines/reference/tsxElementResolution11.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(17,7): error TS2322: Type '{ x: 10; }' is not assignable to type '{ q?: number; }'. - Weak type '{ q?: number; }' has no properties in common with '{ x: 10; }'. +tests/cases/conformance/jsx/file.tsx(17,7): error TS2559: Type '{ x: 10; }' has no properties in common with type '{ q?: number; }'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -21,8 +20,7 @@ tests/cases/conformance/jsx/file.tsx(17,7): error TS2322: Type '{ x: 10; }' is n var Obj2: Obj2type; ; // Error ~~~~~~ -!!! error TS2322: Type '{ x: 10; }' is not assignable to type '{ q?: number; }'. -!!! error TS2322: Weak type '{ q?: number; }' has no properties in common with '{ x: 10; }'. +!!! error TS2559: Type '{ x: 10; }' has no properties in common with type '{ q?: number; }'. interface Obj3type { new(n: string): { x: number; }; diff --git a/tests/baselines/reference/tsxGenericAttributesType5.errors.txt b/tests/baselines/reference/tsxGenericAttributesType5.errors.txt index 9c67ece048c..83f07326f92 100644 --- a/tests/baselines/reference/tsxGenericAttributesType5.errors.txt +++ b/tests/baselines/reference/tsxGenericAttributesType5.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(12,20): error TS2322: Type 'U & { x: "hi"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }'. - Weak type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }' has no properties in common with 'U & { x: "hi"; }'. +tests/cases/conformance/jsx/file.tsx(12,36): error TS2339: Property 'x' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -15,8 +14,7 @@ tests/cases/conformance/jsx/file.tsx(12,20): error TS2322: Type 'U & { x: "hi"; render() { // Should be an ok but as of 2.3.3 this will be an error as we will instantiate B1.props to be empty object return ; - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'U & { x: "hi"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }'. -!!! error TS2322: Weak type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }' has no properties in common with 'U & { x: "hi"; }'. + ~~~~~~ +!!! error TS2339: Property 'x' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }'. } } \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt b/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt index 3dda3667ff1..54f36da535b 100644 --- a/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt +++ b/tests/baselines/reference/tsxReactComponentWithDefaultTypeParameter3.errors.txt @@ -1,7 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(16,17): error TS2322: Type '{ a: 10; b: "hi"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }'. - Weak type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }' has no properties in common with '{ a: 10; b: "hi"; }'. -tests/cases/conformance/jsx/file.tsx(17,18): error TS2322: Type '{ a: "hi"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }'. - Weak type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }' has no properties in common with '{ a: "hi"; }'. +tests/cases/conformance/jsx/file.tsx(16,17): error TS2559: Type '{ a: 10; b: "hi"; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(17,18): error TS2559: Type '{ a: "hi"; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }'. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -22,9 +20,7 @@ tests/cases/conformance/jsx/file.tsx(17,18): error TS2322: Type '{ a: "hi"; }' i // Error let x = ~~~~~~~~~~~~~ -!!! error TS2322: Type '{ a: 10; b: "hi"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }'. -!!! error TS2322: Weak type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }' has no properties in common with '{ a: 10; b: "hi"; }'. +!!! error TS2559: Type '{ a: 10; b: "hi"; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }'. let x2 = ~~~~~~ -!!! error TS2322: Type '{ a: "hi"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }'. -!!! error TS2322: Weak type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }' has no properties in common with '{ a: "hi"; }'. \ No newline at end of file +!!! error TS2559: Type '{ a: "hi"; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes> & { children?: ReactNode; }'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution5.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution5.errors.txt index 26e67cf5492..5642f06897c 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution5.errors.txt +++ b/tests/baselines/reference/tsxSpreadAttributesResolution5.errors.txt @@ -2,8 +2,7 @@ tests/cases/conformance/jsx/file.tsx(20,19): error TS2322: Type '{ x: string; y: Type '{ x: string; y: number; }' is not assignable to type 'PoisonedProp'. Types of property 'y' are incompatible. Type 'number' is not assignable to type '2'. -tests/cases/conformance/jsx/file.tsx(33,20): error TS2322: Type '{ prop1: boolean; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. - Weak type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }' has no properties in common with '{ prop1: boolean; }'. +tests/cases/conformance/jsx/file.tsx(33,20): error TS2559: Type '{ prop1: boolean; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -46,5 +45,4 @@ tests/cases/conformance/jsx/file.tsx(33,20): error TS2322: Type '{ prop1: boolea // Ok let e = ; ~~~~~~ -!!! error TS2322: Type '{ prop1: boolean; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. -!!! error TS2322: Weak type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }' has no properties in common with '{ prop1: boolean; }'. \ No newline at end of file +!!! error TS2559: Type '{ prop1: boolean; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt index 38fe85a087c..91d735bb9ed 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt @@ -5,18 +5,14 @@ tests/cases/conformance/jsx/file.tsx(27,15): error TS2322: Type '{ name: 42; }' Type '{ name: 42; }' is not assignable to type '{ name?: string; }'. Types of property 'name' are incompatible. Type '42' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(29,15): error TS2322: Type '{ naaaaaaame: "no"; }' is not assignable to type 'IntrinsicAttributes & { name?: string; }'. - Weak type 'IntrinsicAttributes & { name?: string; }' has no properties in common with '{ naaaaaaame: "no"; }'. +tests/cases/conformance/jsx/file.tsx(29,15): error TS2559: Type '{ naaaaaaame: "no"; }' has no properties in common with type 'IntrinsicAttributes & { name?: string; }'. tests/cases/conformance/jsx/file.tsx(34,23): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { "prop-name": string; }'. Type '{}' is not assignable to type '{ "prop-name": string; }'. Property '"prop-name"' is missing in type '{}'. -tests/cases/conformance/jsx/file.tsx(37,23): error TS2322: Type '{ prop1: true; }' is not assignable to type 'IntrinsicAttributes'. - Weak type 'IntrinsicAttributes' has no properties in common with '{ prop1: true; }'. -tests/cases/conformance/jsx/file.tsx(38,24): error TS2322: Type '{ ref: (x: any) => any; }' is not assignable to type 'IntrinsicAttributes'. - Weak type 'IntrinsicAttributes' has no properties in common with '{ ref: (x: any) => any; }'. +tests/cases/conformance/jsx/file.tsx(37,23): error TS2559: Type '{ prop1: true; }' has no properties in common with type 'IntrinsicAttributes'. +tests/cases/conformance/jsx/file.tsx(38,24): error TS2559: Type '{ ref: (x: any) => any; }' has no properties in common with type 'IntrinsicAttributes'. tests/cases/conformance/jsx/file.tsx(41,16): error TS1005: ',' expected. -tests/cases/conformance/jsx/file.tsx(45,24): error TS2322: Type '{ prop1: boolean; }' is not assignable to type 'IntrinsicAttributes'. - Weak type 'IntrinsicAttributes' has no properties in common with '{ prop1: boolean; }'. +tests/cases/conformance/jsx/file.tsx(45,24): error TS2559: Type '{ prop1: boolean; }' has no properties in common with type 'IntrinsicAttributes'. ==== tests/cases/conformance/jsx/file.tsx (8 errors) ==== @@ -59,8 +55,7 @@ tests/cases/conformance/jsx/file.tsx(45,24): error TS2322: Type '{ prop1: boolea // Error let f = ; ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ naaaaaaame: "no"; }' is not assignable to type 'IntrinsicAttributes & { name?: string; }'. -!!! error TS2322: Weak type 'IntrinsicAttributes & { name?: string; }' has no properties in common with '{ naaaaaaame: "no"; }'. +!!! error TS2559: Type '{ naaaaaaame: "no"; }' has no properties in common with type 'IntrinsicAttributes & { name?: string; }'. // OK let g = ; @@ -74,12 +69,10 @@ tests/cases/conformance/jsx/file.tsx(45,24): error TS2322: Type '{ prop1: boolea // Error let i = ~~~~~ -!!! error TS2322: Type '{ prop1: true; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2322: Weak type 'IntrinsicAttributes' has no properties in common with '{ prop1: true; }'. +!!! error TS2559: Type '{ prop1: true; }' has no properties in common with type 'IntrinsicAttributes'. let i1 = x.greeting.substr(10)} /> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ ref: (x: any) => any; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2322: Weak type 'IntrinsicAttributes' has no properties in common with '{ ref: (x: any) => any; }'. +!!! error TS2559: Type '{ ref: (x: any) => any; }' has no properties in common with type 'IntrinsicAttributes'. let o = { prop1: true; @@ -90,8 +83,7 @@ tests/cases/conformance/jsx/file.tsx(45,24): error TS2322: Type '{ prop1: boolea // OK as access properties are allow when spread let i2 = ~~~~~~ -!!! error TS2322: Type '{ prop1: boolean; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2322: Weak type 'IntrinsicAttributes' has no properties in common with '{ prop1: boolean; }'. +!!! error TS2559: Type '{ prop1: boolean; }' has no properties in common with type 'IntrinsicAttributes'. let o1: any; // OK diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt index b0c2600532f..1e7a29c3378 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(19,16): error TS2322: Type '{ ref: "myRef"; }' is not assignable to type 'IntrinsicAttributes & { name?: string; }'. - Weak type 'IntrinsicAttributes & { name?: string; }' has no properties in common with '{ ref: "myRef"; }'. +tests/cases/conformance/jsx/file.tsx(19,16): error TS2559: Type '{ ref: "myRef"; }' has no properties in common with type 'IntrinsicAttributes & { name?: string; }'. tests/cases/conformance/jsx/file.tsx(25,42): error TS2339: Property 'subtr' does not exist on type 'string'. tests/cases/conformance/jsx/file.tsx(27,33): error TS2339: Property 'notARealProperty' does not exist on type 'BigGreeter'. tests/cases/conformance/jsx/file.tsx(35,26): error TS2339: Property 'propertyNotOnHtmlDivElement' does not exist on type 'HTMLDivElement'. @@ -26,8 +25,7 @@ tests/cases/conformance/jsx/file.tsx(35,26): error TS2339: Property 'propertyNot // Error - not allowed to specify 'ref' on SFCs let c = ; ~~~~~~~~~~~ -!!! error TS2322: Type '{ ref: "myRef"; }' is not assignable to type 'IntrinsicAttributes & { name?: string; }'. -!!! error TS2322: Weak type 'IntrinsicAttributes & { name?: string; }' has no properties in common with '{ ref: "myRef"; }'. +!!! error TS2559: Type '{ ref: "myRef"; }' has no properties in common with type 'IntrinsicAttributes & { name?: string; }'. // OK - ref is valid for classes diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index 311cfaed86f..2feed16ac0a 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -4,9 +4,9 @@ tests/cases/conformance/jsx/file.tsx(9,33): error TS2322: Type '{ a: number; }' tests/cases/conformance/jsx/file.tsx(10,33): error TS2322: Type 'T' is not assignable to type 'IntrinsicAttributes & { b: number; a: {}; }'. Type '{ b: number; }' is not assignable to type 'IntrinsicAttributes & { b: number; a: {}; }'. Type '{ b: number; }' is not assignable to type '{ b: number; a: {}; }'. - Type 'T' is not assignable to type '{ b: number; a: {}; }'. - Type '{ b: number; }' is not assignable to type '{ b: number; a: {}; }'. - Property 'a' is missing in type '{ b: number; }'. + Property 'a' is missing in type '{ b: number; }'. + Type 'T' is not assignable to type 'IntrinsicAttributes'. + Type '{ b: number; }' has no properties in common with type 'IntrinsicAttributes'. ==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== @@ -28,7 +28,7 @@ tests/cases/conformance/jsx/file.tsx(10,33): error TS2322: Type 'T' is not assig !!! error TS2322: Type 'T' is not assignable to type 'IntrinsicAttributes & { b: number; a: {}; }'. !!! error TS2322: Type '{ b: number; }' is not assignable to type 'IntrinsicAttributes & { b: number; a: {}; }'. !!! error TS2322: Type '{ b: number; }' is not assignable to type '{ b: number; a: {}; }'. -!!! error TS2322: Type 'T' is not assignable to type '{ b: number; a: {}; }'. -!!! error TS2322: Type '{ b: number; }' is not assignable to type '{ b: number; a: {}; }'. -!!! error TS2322: Property 'a' is missing in type '{ b: number; }'. +!!! error TS2322: Property 'a' is missing in type '{ b: number; }'. +!!! error TS2322: Type 'T' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2322: Type '{ b: number; }' has no properties in common with type 'IntrinsicAttributes'. } \ No newline at end of file diff --git a/tests/baselines/reference/tsxUnionElementType4.errors.txt b/tests/baselines/reference/tsxUnionElementType4.errors.txt index dc86c847350..3e0f625c4d3 100644 --- a/tests/baselines/reference/tsxUnionElementType4.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType4.errors.txt @@ -3,10 +3,8 @@ tests/cases/conformance/jsx/file.tsx(32,17): error TS2322: Type '{ x: true; }' i Type '{ x: true; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. Type 'true' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(33,21): error TS2322: Type '{ x: 10; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. - Weak type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }' has no properties in common with '{ x: 10; }'. -tests/cases/conformance/jsx/file.tsx(34,22): error TS2322: Type '{ prop: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. - Weak type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }' has no properties in common with '{ prop: true; }'. +tests/cases/conformance/jsx/file.tsx(33,21): error TS2559: Type '{ x: 10; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. +tests/cases/conformance/jsx/file.tsx(34,22): error TS2559: Type '{ prop: true; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. ==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== @@ -50,10 +48,8 @@ tests/cases/conformance/jsx/file.tsx(34,22): error TS2322: Type '{ prop: true; } !!! error TS2322: Type 'true' is not assignable to type 'string'. let b = ~~~~~~ -!!! error TS2322: Type '{ x: 10; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. -!!! error TS2322: Weak type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }' has no properties in common with '{ x: 10; }'. +!!! error TS2559: Type '{ x: 10; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. let c = ; ~~~~ -!!! error TS2322: Type '{ prop: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. -!!! error TS2322: Weak type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }' has no properties in common with '{ prop: true; }'. +!!! error TS2559: Type '{ prop: true; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxUnionElementType6.errors.txt b/tests/baselines/reference/tsxUnionElementType6.errors.txt index 98929a838f6..854a84eb85e 100644 --- a/tests/baselines/reference/tsxUnionElementType6.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType6.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(18,23): error TS2322: Type '{ x: true; }' is not assignable to type 'IntrinsicAttributes'. - Weak type 'IntrinsicAttributes' has no properties in common with '{ x: true; }'. +tests/cases/conformance/jsx/file.tsx(18,23): error TS2559: Type '{ x: true; }' has no properties in common with type 'IntrinsicAttributes'. tests/cases/conformance/jsx/file.tsx(19,27): error TS2322: Type '{ x: "hi"; }' is not assignable to type 'IntrinsicAttributes & { x: boolean; }'. Type '{ x: "hi"; }' is not assignable to type '{ x: boolean; }'. Types of property 'x' are incompatible. @@ -32,8 +31,7 @@ tests/cases/conformance/jsx/file.tsx(21,27): error TS2322: Type '{}' is not assi // Error let a = ; ~ -!!! error TS2322: Type '{ x: true; }' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2322: Weak type 'IntrinsicAttributes' has no properties in common with '{ x: true; }'. +!!! error TS2559: Type '{ x: true; }' has no properties in common with type 'IntrinsicAttributes'. let b = ; ~~~~~~ !!! error TS2322: Type '{ x: "hi"; }' is not assignable to type 'IntrinsicAttributes & { x: boolean; }'. diff --git a/tests/baselines/reference/weakType.errors.txt b/tests/baselines/reference/weakType.errors.txt index 432f3dfd8e3..7064ace5daa 100644 --- a/tests/baselines/reference/weakType.errors.txt +++ b/tests/baselines/reference/weakType.errors.txt @@ -1,10 +1,8 @@ -tests/cases/compiler/weakType.ts(31,18): error TS2345: Argument of type '{ error?: number; }' is not assignable to parameter of type 'ChangeOptions'. - Weak type 'ChangeOptions' has no properties in common with '{ error?: number; }'. +tests/cases/compiler/weakType.ts(31,18): error TS2559: Type '{ error?: number; }' has no properties in common with type 'ChangeOptions'. tests/cases/compiler/weakType.ts(56,5): error TS2322: Type '{ properties: { wrong: string; }; }' is not assignable to type 'Weak & Spoiler'. Type '{ properties: { wrong: string; }; }' is not assignable to type 'Weak'. Types of property 'properties' are incompatible. - Type '{ wrong: string; }' is not assignable to type '{ b?: number; }'. - Weak type '{ b?: number; }' has no properties in common with '{ wrong: string; }'. + Type '{ wrong: string; }' has no properties in common with type '{ b?: number; }'. ==== tests/cases/compiler/weakType.ts (2 errors) ==== @@ -40,8 +38,7 @@ tests/cases/compiler/weakType.ts(56,5): error TS2322: Type '{ properties: { wron changes.push(options); changes.push(error); ~~~~~ -!!! error TS2345: Argument of type '{ error?: number; }' is not assignable to parameter of type 'ChangeOptions'. -!!! error TS2345: Weak type 'ChangeOptions' has no properties in common with '{ error?: number; }'. +!!! error TS2559: Type '{ error?: number; }' has no properties in common with type 'ChangeOptions'. } class K { @@ -71,6 +68,5 @@ tests/cases/compiler/weakType.ts(56,5): error TS2322: Type '{ properties: { wron !!! error TS2322: Type '{ properties: { wrong: string; }; }' is not assignable to type 'Weak & Spoiler'. !!! error TS2322: Type '{ properties: { wrong: string; }; }' is not assignable to type 'Weak'. !!! error TS2322: Types of property 'properties' are incompatible. -!!! error TS2322: Type '{ wrong: string; }' is not assignable to type '{ b?: number; }'. -!!! error TS2322: Weak type '{ b?: number; }' has no properties in common with '{ wrong: string; }'. +!!! error TS2322: Type '{ wrong: string; }' has no properties in common with type '{ b?: number; }'. \ No newline at end of file