Accepted baselines.

This commit is contained in:
Daniel Rosenwasser
2018-07-10 14:55:33 -07:00
parent 94ad71ecc3
commit 751bceb94e
4 changed files with 142 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
tests/cases/compiler/nestedRecursiveArraysOrObjectsError01.ts(10,9): error TS2322: Type '{ foo: string; jj: number; }[][][]' is not assignable to type 'Style'.
Type '{ foo: string; jj: number; }[][][]' is not assignable to type 'StyleArray'.
Types of property 'pop' are incompatible.
Type '() => { foo: string; jj: number; }[][]' is not assignable to type '() => Style'.
Type '{ foo: string; jj: number; }[][]' is not assignable to type 'Style'.
Type '{ foo: string; jj: number; }[][]' is not assignable to type 'StyleArray'.
Types of property 'pop' are incompatible.
Type '() => { foo: string; jj: number; }[]' is not assignable to type '() => Style'.
Type '{ foo: string; jj: number; }[]' is not assignable to type 'Style'.
Type '{ foo: string; jj: number; }[]' is not assignable to type 'StyleArray'.
Types of property 'pop' are incompatible.
Type '() => { foo: string; jj: number; }' is not assignable to type '() => Style'.
Type '{ foo: string; jj: number; }' is not assignable to type 'Style'.
Object literal may only specify known properties, and 'jj' does not exist in type 'Style'.
==== tests/cases/compiler/nestedRecursiveArraysOrObjectsError01.ts (1 errors) ====
type Style = StyleBase | StyleArray;
interface StyleArray extends Array<Style> {}
interface StyleBase {
foo: string;
}
const blah: Style = [
[[{
foo: 'asdf',
jj: 1 // intentional error
~~~~~
!!! error TS2322: Type '{ foo: string; jj: number; }[][][]' is not assignable to type 'Style'.
!!! error TS2322: Type '{ foo: string; jj: number; }[][][]' is not assignable to type 'StyleArray'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => { foo: string; jj: number; }[][]' is not assignable to type '() => Style'.
!!! error TS2322: Type '{ foo: string; jj: number; }[][]' is not assignable to type 'Style'.
!!! error TS2322: Type '{ foo: string; jj: number; }[][]' is not assignable to type 'StyleArray'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => { foo: string; jj: number; }[]' is not assignable to type '() => Style'.
!!! error TS2322: Type '{ foo: string; jj: number; }[]' is not assignable to type 'Style'.
!!! error TS2322: Type '{ foo: string; jj: number; }[]' is not assignable to type 'StyleArray'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => { foo: string; jj: number; }' is not assignable to type '() => Style'.
!!! error TS2322: Type '{ foo: string; jj: number; }' is not assignable to type 'Style'.
!!! error TS2322: Object literal may only specify known properties, and 'jj' does not exist in type 'Style'.
}]]
];

View File

@@ -0,0 +1,23 @@
//// [nestedRecursiveArraysOrObjectsError01.ts]
type Style = StyleBase | StyleArray;
interface StyleArray extends Array<Style> {}
interface StyleBase {
foo: string;
}
const blah: Style = [
[[{
foo: 'asdf',
jj: 1 // intentional error
}]]
];
//// [nestedRecursiveArraysOrObjectsError01.js]
var blah = [
[[{
foo: 'asdf',
jj: 1 // intentional error
}]]
];

View File

@@ -0,0 +1,33 @@
=== tests/cases/compiler/nestedRecursiveArraysOrObjectsError01.ts ===
type Style = StyleBase | StyleArray;
>Style : Symbol(Style, Decl(nestedRecursiveArraysOrObjectsError01.ts, 0, 0))
>StyleBase : Symbol(StyleBase, Decl(nestedRecursiveArraysOrObjectsError01.ts, 1, 44))
>StyleArray : Symbol(StyleArray, Decl(nestedRecursiveArraysOrObjectsError01.ts, 0, 36))
interface StyleArray extends Array<Style> {}
>StyleArray : Symbol(StyleArray, Decl(nestedRecursiveArraysOrObjectsError01.ts, 0, 36))
>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>Style : Symbol(Style, Decl(nestedRecursiveArraysOrObjectsError01.ts, 0, 0))
interface StyleBase {
>StyleBase : Symbol(StyleBase, Decl(nestedRecursiveArraysOrObjectsError01.ts, 1, 44))
foo: string;
>foo : Symbol(StyleBase.foo, Decl(nestedRecursiveArraysOrObjectsError01.ts, 2, 21))
}
const blah: Style = [
>blah : Symbol(blah, Decl(nestedRecursiveArraysOrObjectsError01.ts, 6, 5))
>Style : Symbol(Style, Decl(nestedRecursiveArraysOrObjectsError01.ts, 0, 0))
[[{
foo: 'asdf',
>foo : Symbol(foo, Decl(nestedRecursiveArraysOrObjectsError01.ts, 7, 7))
jj: 1 // intentional error
>jj : Symbol(jj, Decl(nestedRecursiveArraysOrObjectsError01.ts, 8, 20))
}]]
];

View File

@@ -0,0 +1,40 @@
=== tests/cases/compiler/nestedRecursiveArraysOrObjectsError01.ts ===
type Style = StyleBase | StyleArray;
>Style : Style
>StyleBase : StyleBase
>StyleArray : StyleArray
interface StyleArray extends Array<Style> {}
>StyleArray : StyleArray
>Array : T[]
>Style : Style
interface StyleBase {
>StyleBase : StyleBase
foo: string;
>foo : string
}
const blah: Style = [
>blah : Style
>Style : Style
>[ [[{ foo: 'asdf', jj: 1 // intentional error }]]] : { foo: string; jj: number; }[][][]
[[{
>[[{ foo: 'asdf', jj: 1 // intentional error }]] : { foo: string; jj: number; }[][]
>[{ foo: 'asdf', jj: 1 // intentional error }] : { foo: string; jj: number; }[]
>{ foo: 'asdf', jj: 1 // intentional error } : { foo: string; jj: number; }
foo: 'asdf',
>foo : string
>'asdf' : "asdf"
jj: 1 // intentional error
>jj : number
>1 : 1
}]]
];