tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypeReferences1.ts(45,7): error TS2322: Type '42' is not assignable to type 'Box2'.
tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypeReferences1.ts(60,7): error TS2322: Type 'number' is not assignable to type 'string | RecArray<string>'.
tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypeReferences1.ts(66,8): error TS2322: Type 'number' is not assignable to type 'string | string[]'.
tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypeReferences1.ts(72,8): error TS2322: Type 'number' is not assignable to type 'string | (string | string[])[]'.


==== tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypeReferences1.ts (4 errors) ====
    type ValueOrArray<T> = T | Array<ValueOrArray<T>>;
    
    const a0: ValueOrArray<number> = 1;
    const a1: ValueOrArray<number> = [1, [2, 3], [4, [5, [6, 7]]]];
    
    type HypertextNode = string | [string, { [key: string]: unknown }, ...HypertextNode[]];
    
    const hypertextNode: HypertextNode =
        ["div", { id: "parent" },
            ["div", { id: "first-child" }, "I'm the first child"],
            ["div", { id: "second-child" }, "I'm the second child"]
        ];
    
    type Json = string | number | boolean | null | Json[] | { [key: string]: Json };
    
    let data: Json = {
        caption: "Test",
        location: { x: 10, y: 20 },
        values: [true, [10, 20], null]
    };
    
    interface Box<T> { value: T };
    
    type T1 = Box<T1>;
    type T2 = Box<Box<T2>>;
    type T3 = Box<Box<Box<T3>>>;
    
    function f1(t1: T1, t2: T2, t3: T3) {
        t1 = t2;
        t1 = t3;
        t2 = t1;
        t2 = t3;
        t3 = t1;
        t3 = t2;
    }
    
    type Box1 = Box<Box1> | number;
    
    const b10: Box1 = 42;
    const b11: Box1 = { value: 42 };
    const b12: Box1 = { value: { value: { value: 42 }}};
    
    type Box2 = Box<Box2 | number>;
    
    const b20: Box2 = 42;  // Error
          ~~~
!!! error TS2322: Type '42' is not assignable to type 'Box2'.
    const b21: Box2 = { value: 42 };
    const b22: Box2 = { value: { value: { value: 42 }}};
    
    type RecArray<T> = Array<T | RecArray<T>>;
    
    declare function flat<T>(a: RecArray<T>): Array<T>;
    declare function flat1<T>(a: Array<T | Array<T>>): Array<T>
    declare function flat2<T>(a: Array<T | Array<T | Array<T>>>): Array<T>;
    
    flat([1, [2, [3]]]);  // number[]
    flat([[[0]]]);  // number[]
    flat([[[[[[[[[[[4]]]]]]]]]]]);  // number[]
    flat([1, 'a', [2]]);  // (string | number)[]
    flat([1, [2, 'a']]);  // (string | number)[]
    flat([1, ['a']]);  // Error
          ~
!!! error TS2322: Type 'number' is not assignable to type 'string | RecArray<string>'.
    
    flat1([1, [2, [3]]]);  // (number | number[])[]
    flat1([[[0]]]);  // number[][]
    flat1([1, 'a', [2]]);  // (string | number)[]
    flat1([1, [2, 'a']]);  // (string | number)[]
    flat1([1, ['a']]);  // Error
           ~
!!! error TS2322: Type 'number' is not assignable to type 'string | string[]'.
    
    flat2([1, [2, [3]]]);  // number[]
    flat2([[[0]]]);  // number[]
    flat2([1, 'a', [2]]);  // (string | number)[]
    flat2([1, [2, 'a']]);  // (string | number)[]
    flat2([1, ['a']]);  // Error
           ~
!!! error TS2322: Type 'number' is not assignable to type 'string | (string | string[])[]'.
    
    type T10 = T10[];
    type T11 = readonly T11[];
    type T12 = (T12)[];
    type T13 = T13[] | string;
    type T14 = T14[] & { x: string };
    type T15<X> = X extends string ? T15<X>[] : never;
    