Skip to content

Not reporting error of deep object literal as expected #34619

Closed
@vilicvane

Description

@vilicvane

TypeScript Version: 3.6.3 / 3.7.0-dev.20191021

Search Terms: type check, no error, large object

Code

interface A {
  b: B[];
}

interface B {
  c: C;
}

interface C {
  d: D[];
}

interface D {
  e: E[];
}

interface E {
  f: F[];
}

interface F {
  g: G;
}

interface G {
  h: H[];
}

interface H {
  i: string;
}

const x: A = {
  b: [
    {
      c: {
        d: [
          {
            e: [
              {
                f: [
                  {
                    g: {
                      h: [
                        {
                          // intellisense still works, but type check fails here
                          // i: '',
                        },
                      ],
                    },
                  },
                ],
              },
            ],
          },
        ],
      },
    },
  ],
};

Expected behavior:

Reporting error as property i is missing.

Actual behavior:

No error.

Playground Link: http://www.typescriptlang.org/play/?ts=Nightly&ssl=1&ssc=1&pln=61&pc=1#code/JYOwLgpgTgZghgYwgAgILIN4ChnIEYBcyAQgNoC6A3FgL5ZaiSyIrGY7IJEDC1dD4aPCTJu7XABMiAEQp96jIS2TTxyCEQCic2gsHMRmtTCIAxHf0UGUptQHMiAcXkCmwlI7UALIgAkLem7KvmrARADOYFCgdi4IAPYgkcgAHkToALxqhMikHLjYuEWcRIXFRVK5+eUF1TW4GlX19WXNNSZNbc2tXfUOar1tPp2DXT2jbQD0k8hgAJ4ADigIXhAIANbI8MAANuHIq1AQdRP108hhyADkVwA0J6dFNPePNeQvr7jPD73fj+8-Gp-XoArrAt4fYrg5DAgE0ahAA

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions