Skip to content

Commit

Permalink
Accept new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Feb 7, 2022
1 parent adb37a5 commit 16b986b
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests/cases/conformance/jsdoc/0.js(5,3): error TS2322: Type 'number' is not assignable to type 'string | undefined'.
tests/cases/conformance/jsdoc/0.js(5,3): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/jsdoc/0.js(8,7): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/jsdoc/0.js(11,20): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/jsdoc/0.js(13,15): error TS2322: Type 'string' is not assignable to type 'number'.
Expand All @@ -15,7 +15,7 @@ tests/cases/conformance/jsdoc/0.js(22,22): error TS2345: Argument of type 'strin
/** @type {string|undefined} */
bar: 42,
~~~~~~~
!!! error TS2322: Type 'number' is not assignable to type 'string | undefined'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
/** @type {function(number): number} */
method1(n1) {
return "42";
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/divergentAccessorsTypes2.errors.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests/cases/compiler/divergentAccessorsTypes2.ts(10,1): error TS2322: Type '42' is not assignable to type 'string | undefined'.
tests/cases/compiler/divergentAccessorsTypes2.ts(10,1): error TS2322: Type 'number' is not assignable to type 'string'.


==== tests/cases/compiler/divergentAccessorsTypes2.ts (1 errors) ====
Expand All @@ -13,5 +13,5 @@ tests/cases/compiler/divergentAccessorsTypes2.ts(10,1): error TS2322: Type '42'
s.foo = "hello";
s.foo = 42;
~~~~~
!!! error TS2322: Type '42' is not assignable to type 'string | undefined'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceExtendsObjectI
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceExtendsObjectIntersectionErrors.ts(35,29): error TS2411: Property 'a' of type '"hello"' is not assignable to 'string' index type 'number'.
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceExtendsObjectIntersectionErrors.ts(39,11): error TS2430: Interface 'I20' incorrectly extends interface 'Partial<T1>'.
Types of property 'a' are incompatible.
Type 'string' is not assignable to type 'number | undefined'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceExtendsObjectIntersectionErrors.ts(40,11): error TS2430: Interface 'I21' incorrectly extends interface 'Readonly<T1>'.
Types of property 'a' are incompatible.
Type 'string' is not assignable to type 'number'.
Expand Down Expand Up @@ -154,7 +154,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceExtendsObjectI
~~~
!!! error TS2430: Interface 'I20' incorrectly extends interface 'Partial<T1>'.
!!! error TS2430: Types of property 'a' are incompatible.
!!! error TS2430: Type 'string' is not assignable to type 'number | undefined'.
!!! error TS2430: Type 'string' is not assignable to type 'number'.
interface I21 extends Readonly<T1> { a: string }
~~~
!!! error TS2430: Interface 'I21' incorrectly extends interface 'Readonly<T1>'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ tests/cases/compiler/intersectionPropertyCheck.ts(4,5): error TS2322: Type '{ a:
Type '{ y: string; }' has no properties in common with type '{ x?: number | undefined; }'.
tests/cases/compiler/intersectionPropertyCheck.ts(7,3): error TS2322: Type 'T & { a: boolean; }' is not assignable to type '{ a?: string | undefined; }'.
Types of property 'a' are incompatible.
Type 'boolean' is not assignable to type 'string | undefined'.
tests/cases/compiler/intersectionPropertyCheck.ts(17,22): error TS2322: Type 'true' is not assignable to type 'string[] | undefined'.
Type 'boolean' is not assignable to type 'string'.
tests/cases/compiler/intersectionPropertyCheck.ts(17,22): error TS2322: Type 'boolean' is not assignable to type 'string[]'.


==== tests/cases/compiler/intersectionPropertyCheck.ts (4 errors) ====
Expand All @@ -28,7 +28,7 @@ tests/cases/compiler/intersectionPropertyCheck.ts(17,22): error TS2322: Type 'tr
~
!!! error TS2322: Type 'T & { a: boolean; }' is not assignable to type '{ a?: string | undefined; }'.
!!! error TS2322: Types of property 'a' are incompatible.
!!! error TS2322: Type 'boolean' is not assignable to type 'string | undefined'.
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
}

// Repro from #36637
Expand All @@ -40,7 +40,7 @@ tests/cases/compiler/intersectionPropertyCheck.ts(17,22): error TS2322: Type 'tr
function test<T extends object>(value: T): Test {
return { ...value, hi: true }
~~
!!! error TS2322: Type 'true' is not assignable to type 'string[] | undefined'.
!!! error TS2322: Type 'boolean' is not assignable to type 'string[]'.
!!! related TS6500 tests/cases/compiler/intersectionPropertyCheck.ts:13:12: The expected type comes from property 'hi' which is declared here on type 'Test'
}

12 changes: 6 additions & 6 deletions tests/baselines/reference/mappedTypeErrors.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(106,17): error TS2345:
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(123,14): error TS2322: Type 'undefined' is not assignable to type 'string'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(124,14): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick<Foo, keyof Foo>'.
Object literal may only specify known properties, and 'c' does not exist in type 'Pick<Foo, keyof Foo>'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,16): error TS2322: Type 'string' is not assignable to type 'number | undefined'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,25): error TS2322: Type 'string' is not assignable to type 'number | undefined'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,39): error TS2322: Type 'string' is not assignable to type 'number | undefined'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,16): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,25): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,39): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,16): error TS2322: Type 'T' is not assignable to type 'string | number | symbol'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: Type 'P' cannot be used to index type 'T'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(148,17): error TS2339: Property 'foo' does not exist on type 'Pick<T, K>'.
Expand Down Expand Up @@ -222,15 +222,15 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339:

let x1: T2 = { a: 'no' }; // Error
~
!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! related TS6500 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:126:13: The expected type comes from property 'a' which is declared here on type 'T2'
let x2: Partial<T2> = { a: 'no' }; // Error
~
!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! related TS6500 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:126:13: The expected type comes from property 'a' which is declared here on type 'Partial<T2>'
let x3: { [P in keyof T2]: T2[P]} = { a: 'no' }; // Error
~
!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! related TS6500 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:126:13: The expected type comes from property 'a' which is declared here on type '{ [x: string]: any; a?: number | undefined; }'

// Repro from #13044
Expand Down
24 changes: 12 additions & 12 deletions tests/baselines/reference/objectCreate-errors.errors.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
tests/cases/compiler/objectCreate-errors.ts(1,24): error TS2345: Argument of type '1' is not assignable to parameter of type 'object | null'.
tests/cases/compiler/objectCreate-errors.ts(2,24): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'object | null'.
tests/cases/compiler/objectCreate-errors.ts(3,24): error TS2345: Argument of type 'false' is not assignable to parameter of type 'object | null'.
tests/cases/compiler/objectCreate-errors.ts(1,24): error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'.
tests/cases/compiler/objectCreate-errors.ts(2,24): error TS2345: Argument of type 'string' is not assignable to parameter of type 'object'.
tests/cases/compiler/objectCreate-errors.ts(3,24): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'object'.
tests/cases/compiler/objectCreate-errors.ts(4,24): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object | null'.
tests/cases/compiler/objectCreate-errors.ts(7,24): error TS2345: Argument of type '1' is not assignable to parameter of type 'object | null'.
tests/cases/compiler/objectCreate-errors.ts(8,24): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'object | null'.
tests/cases/compiler/objectCreate-errors.ts(9,24): error TS2345: Argument of type 'false' is not assignable to parameter of type 'object | null'.
tests/cases/compiler/objectCreate-errors.ts(7,24): error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'.
tests/cases/compiler/objectCreate-errors.ts(8,24): error TS2345: Argument of type 'string' is not assignable to parameter of type 'object'.
tests/cases/compiler/objectCreate-errors.ts(9,24): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'object'.
tests/cases/compiler/objectCreate-errors.ts(10,24): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object | null'.


==== tests/cases/compiler/objectCreate-errors.ts (8 errors) ====
var e1 = Object.create(1); // Error
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'object | null'.
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'.
var e2 = Object.create("string"); // Error
~~~~~~~~
!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'object | null'.
!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'object'.
var e3 = Object.create(false); // Error
~~~~~
!!! error TS2345: Argument of type 'false' is not assignable to parameter of type 'object | null'.
!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'object'.
var e4 = Object.create(undefined); // Error
~~~~~~~~~
!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object | null'.


var e5 = Object.create(1, {}); // Error
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'object | null'.
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'.
var e6 = Object.create("string", {}); // Error
~~~~~~~~
!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'object | null'.
!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'object'.
var e7 = Object.create(false, {}); // Error
~~~~~
!!! error TS2345: Argument of type 'false' is not assignable to parameter of type 'object | null'.
!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'object'.
var e8 = Object.create(undefined, {}); // Error
~~~~~~~~~
!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object | null'.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(7,14): error TS2322: Type 'number' is not assignable to type 'string | undefined'.
tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(7,14): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(8,1): error TS2322: Type '{ b: string; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'.
Type '{ b: string; }' is missing the following properties from type '{ a: number; b: string; c: boolean; }': a, c
tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(9,1): error TS2322: Type '{ c: true; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'.
Expand All @@ -22,7 +22,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts
a1 = { a: 1 };
a1 = { a: 0, b: 0 }; // Error
~
!!! error TS2322: Type 'number' is not assignable to type 'string | undefined'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! related TS6500 tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts:2:47: The expected type comes from property 'b' which is declared here on type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'
a1 = { b: "y" }; // Error
~~
Expand Down
12 changes: 6 additions & 6 deletions tests/baselines/reference/tsxLibraryManagedAttributes.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(55,12): error TS2322
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(57,41): error TS2322: Type '{ bar: string; baz: string; bat: string; }' is not assignable to type 'Defaultize<InferredPropTypes<{ foo: PropTypeChecker<number, false>; bar: PropTypeChecker<ReactNode, false>; baz: PropTypeChecker<string, true>; }>, { foo: number; }>'.
Property 'bat' does not exist on type 'Defaultize<InferredPropTypes<{ foo: PropTypeChecker<number, false>; bar: PropTypeChecker<ReactNode, false>; baz: PropTypeChecker<string, true>; }>, { foo: number; }>'.
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(59,42): error TS2322: Type 'null' is not assignable to type 'string'.
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(69,26): error TS2322: Type 'string' is not assignable to type 'number | null | undefined'.
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(69,26): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(71,35): error TS2322: Type 'null' is not assignable to type 'ReactNode'.
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(80,38): error TS2322: Type '{ foo: number; bar: string; }' is not assignable to type 'Defaultize<{}, { foo: number; }>'.
Property 'bar' does not exist on type 'Defaultize<{}, { foo: number; }>'.
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(81,29): error TS2322: Type 'string' is not assignable to type 'number | undefined'.
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(81,29): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(98,12): error TS2322: Type '{ foo: string; }' is not assignable to type 'Defaultize<FooProps & InferredPropTypes<{ foo: PropTypeChecker<string, false>; bar: PropTypeChecker<ReactNode, false>; baz: PropTypeChecker<number, true>; }>, { foo: string; }>'.
Type '{ foo: string; }' is missing the following properties from type '{ bar: ReactNode | null | undefined; baz: number; }': bar, baz
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(100,56): error TS2322: Type '{ bar: string; baz: number; bat: string; }' is not assignable to type 'Defaultize<FooProps & InferredPropTypes<{ foo: PropTypeChecker<string, false>; bar: PropTypeChecker<ReactNode, false>; baz: PropTypeChecker<number, true>; }>, { foo: string; }>'.
Expand All @@ -18,7 +18,7 @@ tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(112,46): error TS232
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(113,57): error TS2322: Type 'null' is not assignable to type 'ReactNode'.
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(122,58): error TS2322: Type '{ foo: string; bar: string; }' is not assignable to type 'Defaultize<FooProps, { foo: string; }>'.
Property 'bar' does not exist on type 'Defaultize<FooProps, { foo: string; }>'.
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(123,49): error TS2322: Type 'number' is not assignable to type 'string | undefined'.
tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(123,49): error TS2322: Type 'number' is not assignable to type 'string'.


==== tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx (15 errors) ====
Expand Down Expand Up @@ -100,7 +100,7 @@ tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(123,49): error TS232
const g = <JustPropTypes foo={12} bar="ok" />;
const h = <JustPropTypes foo="no" />; // error, wrong type
~~~
!!! error TS2322: Type 'string' is not assignable to type 'number | null | undefined'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! related TS6500 tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx:63:9: The expected type comes from property 'foo' which is declared here on type 'InferredPropTypes<{ foo: PropTypeChecker<number, false>; bar: PropTypeChecker<ReactNode, true>; }>'
const i = <JustPropTypes foo={null} bar="ok" />;
const j = <JustPropTypes foo={12} bar={null} />; // error, bar is required
Expand All @@ -121,7 +121,7 @@ tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(123,49): error TS232
!!! error TS2322: Property 'bar' does not exist on type 'Defaultize<{}, { foo: number; }>'.
const m = <JustDefaultProps foo="no" />; // error, wrong type
~~~
!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! related TS6500 tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx:75:9: The expected type comes from property 'foo' which is declared here on type 'Defaultize<{}, { foo: number; }>'

interface FooProps {
Expand Down Expand Up @@ -186,7 +186,7 @@ tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx(123,49): error TS232
!!! error TS2322: Property 'bar' does not exist on type 'Defaultize<FooProps, { foo: string; }>'.
const z = <JustDefaultPropsWithSpecifiedGeneric foo={12} />; // error, wrong type
~~~
!!! error TS2322: Type 'number' is not assignable to type 'string | undefined'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! related TS6500 tests/cases/conformance/jsx/tsxLibraryManagedAttributes.tsx:117:9: The expected type comes from property 'foo' which is declared here on type 'Defaultize<FooProps, { foo: string; }>'
const aa = <JustDefaultPropsWithSpecifiedGeneric />;

Loading

0 comments on commit 16b986b

Please sign in to comment.