Accepted baselines.

This commit is contained in:
Daniel Rosenwasser
2018-06-28 16:00:51 -07:00
parent c853d7c048
commit 584e923f42
11 changed files with 114 additions and 28 deletions
@@ -1,4 +1,4 @@
tests/cases/conformance/jsdoc/0.js(5,3): error TS2322: Type 'number' is not assignable to type 'string'.
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(7,3): error TS2322: Type '(n1: number) => string' is not assignable to type '(arg0: number) => number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/jsdoc/0.js(11,3): error TS2322: Type '(n1: number) => string' is not assignable to type '(arg0: number) => number'.
@@ -16,7 +16,7 @@ tests/cases/conformance/jsdoc/0.js(22,22): error TS2345: Argument of type '"0"'
/** @type {string|undefined} */
bar: 42,
~~~~~~~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string | undefined'.
/** @type {function(number): number} */
method1(n1) {
~~~~~~~
@@ -0,0 +1,31 @@
tests/cases/compiler/elaboratedErrorsOnNullableTargets01.ts(4,1): error TS2322: Type '{ foo: { bar: number; }; }' is not assignable to type '{ foo: { bar: string; }; }'.
Types of property 'foo' are incompatible.
Type '{ bar: number; }' is not assignable to type '{ bar: string; }'.
Types of property 'bar' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/elaboratedErrorsOnNullableTargets01.ts(6,1): error TS2322: Type '{ foo: { bar: string; }; }' is not assignable to type '{ foo: { bar: number; }; }'.
Types of property 'foo' are incompatible.
Type '{ bar: string; }' is not assignable to type '{ bar: number; }'.
Types of property 'bar' are incompatible.
Type 'string' is not assignable to type 'number'.
==== tests/cases/compiler/elaboratedErrorsOnNullableTargets01.ts (2 errors) ====
export declare let x: null | { foo: { bar: string | null } | undefined } | undefined;
export declare let y: { foo: { bar: number | undefined } };
x = y;
~
!!! error TS2322: Type '{ foo: { bar: number; }; }' is not assignable to type '{ foo: { bar: string; }; }'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type '{ bar: number; }' is not assignable to type '{ bar: string; }'.
!!! error TS2322: Types of property 'bar' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
y = x;
~
!!! error TS2322: Type '{ foo: { bar: string; }; }' is not assignable to type '{ foo: { bar: number; }; }'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type '{ bar: string; }' is not assignable to type '{ bar: number; }'.
!!! error TS2322: Types of property 'bar' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
@@ -0,0 +1,13 @@
//// [elaboratedErrorsOnNullableTargets01.ts]
export declare let x: null | { foo: { bar: string | null } | undefined } | undefined;
export declare let y: { foo: { bar: number | undefined } };
x = y;
y = x;
//// [elaboratedErrorsOnNullableTargets01.js]
"use strict";
exports.__esModule = true;
exports.x = exports.y;
exports.y = exports.x;
@@ -0,0 +1,19 @@
=== tests/cases/compiler/elaboratedErrorsOnNullableTargets01.ts ===
export declare let x: null | { foo: { bar: string | null } | undefined } | undefined;
>x : Symbol(x, Decl(elaboratedErrorsOnNullableTargets01.ts, 0, 18))
>foo : Symbol(foo, Decl(elaboratedErrorsOnNullableTargets01.ts, 0, 30))
>bar : Symbol(bar, Decl(elaboratedErrorsOnNullableTargets01.ts, 0, 37))
export declare let y: { foo: { bar: number | undefined } };
>y : Symbol(y, Decl(elaboratedErrorsOnNullableTargets01.ts, 1, 18))
>foo : Symbol(foo, Decl(elaboratedErrorsOnNullableTargets01.ts, 1, 23))
>bar : Symbol(bar, Decl(elaboratedErrorsOnNullableTargets01.ts, 1, 30))
x = y;
>x : Symbol(x, Decl(elaboratedErrorsOnNullableTargets01.ts, 0, 18))
>y : Symbol(y, Decl(elaboratedErrorsOnNullableTargets01.ts, 1, 18))
y = x;
>y : Symbol(y, Decl(elaboratedErrorsOnNullableTargets01.ts, 1, 18))
>x : Symbol(x, Decl(elaboratedErrorsOnNullableTargets01.ts, 0, 18))
@@ -0,0 +1,23 @@
=== tests/cases/compiler/elaboratedErrorsOnNullableTargets01.ts ===
export declare let x: null | { foo: { bar: string | null } | undefined } | undefined;
>x : { foo: { bar: string; }; }
>null : null
>foo : { bar: string; }
>bar : string
>null : null
export declare let y: { foo: { bar: number | undefined } };
>y : { foo: { bar: number; }; }
>foo : { bar: number; }
>bar : number
x = y;
>x = y : { foo: { bar: number; }; }
>x : { foo: { bar: string; }; }
>y : { foo: { bar: number; }; }
y = x;
>y = x : { foo: { bar: string; }; }
>y : { foo: { bar: number; }; }
>x : { foo: { bar: string; }; }
@@ -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'.
Type 'string' is not assignable to type 'number | undefined'.
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'.
@@ -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'.
!!! error TS2430: Type 'string' is not assignable to type 'number | undefined'.
interface I21 extends Readonly<T1> { a: string }
~~~
!!! error TS2430: Interface 'I21' incorrectly extends interface 'Readonly<T1>'.
@@ -12,7 +12,7 @@ tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(10
Type 'T & U' is not assignable to type 'number'.
tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(11,9): error TS2322: Type 'T & U' is not assignable to type 'number | undefined'.
Type 'string | undefined' is not assignable to type 'number | undefined'.
Type 'string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number | undefined'.
Type 'T & U' is not assignable to type 'number'.
tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(12,9): error TS2322: Type 'T & U' is not assignable to type 'null | undefined'.
Type 'string | undefined' is not assignable to type 'null | undefined'.
@@ -50,7 +50,7 @@ tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(12
~~
!!! error TS2322: Type 'T & U' is not assignable to type 'number | undefined'.
!!! error TS2322: Type 'string | undefined' is not assignable to type 'number | undefined'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'.
!!! error TS2322: Type 'T & U' is not assignable to type 'number'.
let y6: null | undefined = x; // Error
~~
@@ -39,13 +39,13 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(124,14): error TS2345:
Object literal may only specify known properties, and 'c' does not exist in type 'Pick<Foo, "a" | "b">'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,5): error TS2322: Type '{ a: string; }' is not assignable to type 'T2'.
Types of property 'a' are incompatible.
Type 'string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number | undefined'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,5): error TS2322: Type '{ a: string; }' is not assignable to type 'Partial<T2>'.
Types of property 'a' are incompatible.
Type 'string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number | undefined'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,5): error TS2322: Type '{ a: string; }' is not assignable to type '{ [x: string]: any; a?: number | undefined; }'.
Types of property 'a' are incompatible.
Type 'string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number | undefined'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,16): error TS2322: Type 'T' is not assignable to type 'string | number | symbol'.
Type 'T' is not assignable to type 'symbol'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: Type 'P' cannot be used to index type 'T'.
@@ -242,17 +242,17 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536:
~~
!!! error TS2322: Type '{ a: string; }' is not assignable to type 'T2'.
!!! error TS2322: Types of property 'a' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'.
let x2: Partial<T2> = { a: 'no' }; // Error
~~
!!! error TS2322: Type '{ a: string; }' is not assignable to type 'Partial<T2>'.
!!! error TS2322: Types of property 'a' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'.
let x3: { [P in keyof T2]: T2[P]} = { a: 'no' }; // Error
~~
!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ [x: string]: any; a?: number | undefined; }'.
!!! error TS2322: Types of property 'a' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number | undefined'.
// Repro from #13044
@@ -1,23 +1,23 @@
tests/cases/compiler/objectCreate-errors.ts(1,24): error TS2345: Argument of type '1' 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 'false' is not assignable to parameter of type 'object'.
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(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'.
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 'false' is not assignable to parameter of type 'object'.
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(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'.
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'object | null'.
var e2 = Object.create("string"); // Error
~~~~~~~~
!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'object'.
!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'object | null'.
var e3 = Object.create(false); // Error
~~~~~
!!! error TS2345: Argument of type 'false' is not assignable to parameter of type 'object'.
!!! error TS2345: Argument of type 'false' is not assignable to parameter of type 'object | null'.
var e4 = Object.create(undefined); // Error
~~~~~~~~~
!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object | null'.
@@ -25,13 +25,13 @@ tests/cases/compiler/objectCreate-errors.ts(10,24): error TS2345: Argument of ty
var e5 = Object.create(1, {}); // Error
~
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'object'.
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'object | null'.
var e6 = Object.create("string", {}); // Error
~~~~~~~~
!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'object'.
!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'object | null'.
var e7 = Object.create(false, {}); // Error
~~~~~
!!! error TS2345: Argument of type 'false' is not assignable to parameter of type 'object'.
!!! error TS2345: Argument of type 'false' is not assignable to parameter of type 'object | null'.
var e8 = Object.create(undefined, {}); // Error
~~~~~~~~~
!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object | null'.
@@ -2,7 +2,7 @@ tests/cases/conformance/salsa/a.js(10,5): error TS7008: Member 'twices' implicit
tests/cases/conformance/salsa/a.js(14,5): error TS2322: Type '"hi"' is not assignable to type 'number'.
tests/cases/conformance/salsa/a.js(21,5): error TS2322: Type 'false' is not assignable to type 'number'.
tests/cases/conformance/salsa/a.js(24,5): error TS2322: Type 'null' is not assignable to type 'string | undefined'.
tests/cases/conformance/salsa/a.js(25,5): error TS2322: Type 'false' is not assignable to type 'string'.
tests/cases/conformance/salsa/a.js(25,5): error TS2322: Type 'false' is not assignable to type 'string | undefined'.
tests/cases/conformance/salsa/a.js(26,5): error TS2531: Object is possibly 'null'.
@@ -41,7 +41,7 @@ tests/cases/conformance/salsa/a.js(26,5): error TS2531: Object is possibly 'null
!!! error TS2322: Type 'null' is not assignable to type 'string | undefined'.
this.twice = false // error
~~~~~~~~~~
!!! error TS2322: Type 'false' is not assignable to type 'string'.
!!! error TS2322: Type 'false' is not assignable to type 'string | undefined'.
this.twices.push(1) // error: Object is possibly null
~~~~~~~~~~~
!!! error TS2531: Object is possibly 'null'.
@@ -3,7 +3,7 @@ tests/cases/conformance/salsa/a.js(4,5): error TS7008: Member 'unknowable' impli
tests/cases/conformance/salsa/a.js(5,5): error TS7008: Member 'empty' implicitly has an 'any[]' type.
tests/cases/conformance/salsa/a.js(25,12): error TS7006: Parameter 'a' implicitly has an 'any' type.
tests/cases/conformance/salsa/a.js(25,29): error TS7006: Parameter 'l' implicitly has an 'any[]' type.
tests/cases/conformance/salsa/a.js(37,5): error TS2322: Type '"error"' is not assignable to type 'number'.
tests/cases/conformance/salsa/a.js(37,5): error TS2322: Type '"error"' is not assignable to type 'number | undefined'.
==== tests/cases/conformance/salsa/a.js (6 errors) ====
@@ -55,7 +55,7 @@ tests/cases/conformance/salsa/a.js(37,5): error TS2322: Type '"error"' is not as
b = undefined
b = 'error'
~
!!! error TS2322: Type '"error"' is not assignable to type 'number'.
!!! error TS2322: Type '"error"' is not assignable to type 'number | undefined'.
// l should be any[]
l.push(1)