Skip to content

Commit 751bceb

Browse files
Accepted baselines.
1 parent 94ad71e commit 751bceb

4 files changed

+142
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
tests/cases/compiler/nestedRecursiveArraysOrObjectsError01.ts(10,9): error TS2322: Type '{ foo: string; jj: number; }[][][]' is not assignable to type 'Style'.
2+
Type '{ foo: string; jj: number; }[][][]' is not assignable to type 'StyleArray'.
3+
Types of property 'pop' are incompatible.
4+
Type '() => { foo: string; jj: number; }[][]' is not assignable to type '() => Style'.
5+
Type '{ foo: string; jj: number; }[][]' is not assignable to type 'Style'.
6+
Type '{ foo: string; jj: number; }[][]' is not assignable to type 'StyleArray'.
7+
Types of property 'pop' are incompatible.
8+
Type '() => { foo: string; jj: number; }[]' is not assignable to type '() => Style'.
9+
Type '{ foo: string; jj: number; }[]' is not assignable to type 'Style'.
10+
Type '{ foo: string; jj: number; }[]' is not assignable to type 'StyleArray'.
11+
Types of property 'pop' are incompatible.
12+
Type '() => { foo: string; jj: number; }' is not assignable to type '() => Style'.
13+
Type '{ foo: string; jj: number; }' is not assignable to type 'Style'.
14+
Object literal may only specify known properties, and 'jj' does not exist in type 'Style'.
15+
16+
17+
==== tests/cases/compiler/nestedRecursiveArraysOrObjectsError01.ts (1 errors) ====
18+
type Style = StyleBase | StyleArray;
19+
interface StyleArray extends Array<Style> {}
20+
interface StyleBase {
21+
foo: string;
22+
}
23+
24+
const blah: Style = [
25+
[[{
26+
foo: 'asdf',
27+
jj: 1 // intentional error
28+
~~~~~
29+
!!! error TS2322: Type '{ foo: string; jj: number; }[][][]' is not assignable to type 'Style'.
30+
!!! error TS2322: Type '{ foo: string; jj: number; }[][][]' is not assignable to type 'StyleArray'.
31+
!!! error TS2322: Types of property 'pop' are incompatible.
32+
!!! error TS2322: Type '() => { foo: string; jj: number; }[][]' is not assignable to type '() => Style'.
33+
!!! error TS2322: Type '{ foo: string; jj: number; }[][]' is not assignable to type 'Style'.
34+
!!! error TS2322: Type '{ foo: string; jj: number; }[][]' is not assignable to type 'StyleArray'.
35+
!!! error TS2322: Types of property 'pop' are incompatible.
36+
!!! error TS2322: Type '() => { foo: string; jj: number; }[]' is not assignable to type '() => Style'.
37+
!!! error TS2322: Type '{ foo: string; jj: number; }[]' is not assignable to type 'Style'.
38+
!!! error TS2322: Type '{ foo: string; jj: number; }[]' is not assignable to type 'StyleArray'.
39+
!!! error TS2322: Types of property 'pop' are incompatible.
40+
!!! error TS2322: Type '() => { foo: string; jj: number; }' is not assignable to type '() => Style'.
41+
!!! error TS2322: Type '{ foo: string; jj: number; }' is not assignable to type 'Style'.
42+
!!! error TS2322: Object literal may only specify known properties, and 'jj' does not exist in type 'Style'.
43+
}]]
44+
];
45+
46+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//// [nestedRecursiveArraysOrObjectsError01.ts]
2+
type Style = StyleBase | StyleArray;
3+
interface StyleArray extends Array<Style> {}
4+
interface StyleBase {
5+
foo: string;
6+
}
7+
8+
const blah: Style = [
9+
[[{
10+
foo: 'asdf',
11+
jj: 1 // intentional error
12+
}]]
13+
];
14+
15+
16+
17+
//// [nestedRecursiveArraysOrObjectsError01.js]
18+
var blah = [
19+
[[{
20+
foo: 'asdf',
21+
jj: 1 // intentional error
22+
}]]
23+
];
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
=== tests/cases/compiler/nestedRecursiveArraysOrObjectsError01.ts ===
2+
type Style = StyleBase | StyleArray;
3+
>Style : Symbol(Style, Decl(nestedRecursiveArraysOrObjectsError01.ts, 0, 0))
4+
>StyleBase : Symbol(StyleBase, Decl(nestedRecursiveArraysOrObjectsError01.ts, 1, 44))
5+
>StyleArray : Symbol(StyleArray, Decl(nestedRecursiveArraysOrObjectsError01.ts, 0, 36))
6+
7+
interface StyleArray extends Array<Style> {}
8+
>StyleArray : Symbol(StyleArray, Decl(nestedRecursiveArraysOrObjectsError01.ts, 0, 36))
9+
>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
10+
>Style : Symbol(Style, Decl(nestedRecursiveArraysOrObjectsError01.ts, 0, 0))
11+
12+
interface StyleBase {
13+
>StyleBase : Symbol(StyleBase, Decl(nestedRecursiveArraysOrObjectsError01.ts, 1, 44))
14+
15+
foo: string;
16+
>foo : Symbol(StyleBase.foo, Decl(nestedRecursiveArraysOrObjectsError01.ts, 2, 21))
17+
}
18+
19+
const blah: Style = [
20+
>blah : Symbol(blah, Decl(nestedRecursiveArraysOrObjectsError01.ts, 6, 5))
21+
>Style : Symbol(Style, Decl(nestedRecursiveArraysOrObjectsError01.ts, 0, 0))
22+
23+
[[{
24+
foo: 'asdf',
25+
>foo : Symbol(foo, Decl(nestedRecursiveArraysOrObjectsError01.ts, 7, 7))
26+
27+
jj: 1 // intentional error
28+
>jj : Symbol(jj, Decl(nestedRecursiveArraysOrObjectsError01.ts, 8, 20))
29+
30+
}]]
31+
];
32+
33+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
=== tests/cases/compiler/nestedRecursiveArraysOrObjectsError01.ts ===
2+
type Style = StyleBase | StyleArray;
3+
>Style : Style
4+
>StyleBase : StyleBase
5+
>StyleArray : StyleArray
6+
7+
interface StyleArray extends Array<Style> {}
8+
>StyleArray : StyleArray
9+
>Array : T[]
10+
>Style : Style
11+
12+
interface StyleBase {
13+
>StyleBase : StyleBase
14+
15+
foo: string;
16+
>foo : string
17+
}
18+
19+
const blah: Style = [
20+
>blah : Style
21+
>Style : Style
22+
>[ [[{ foo: 'asdf', jj: 1 // intentional error }]]] : { foo: string; jj: number; }[][][]
23+
24+
[[{
25+
>[[{ foo: 'asdf', jj: 1 // intentional error }]] : { foo: string; jj: number; }[][]
26+
>[{ foo: 'asdf', jj: 1 // intentional error }] : { foo: string; jj: number; }[]
27+
>{ foo: 'asdf', jj: 1 // intentional error } : { foo: string; jj: number; }
28+
29+
foo: 'asdf',
30+
>foo : string
31+
>'asdf' : "asdf"
32+
33+
jj: 1 // intentional error
34+
>jj : number
35+
>1 : 1
36+
37+
}]]
38+
];
39+
40+

0 commit comments

Comments
 (0)