Open
Description
Bug Report
π Search Terms
- Array.flat
- Type instantiation is excessively deep and possibly infinite.
- Nested arrays
π Version & Regression Information
- This changed between versions 4.6 and 4.7
β― Playground Link
TypeScript Workbench with relevant code
π» Code
interface Config {
prop?: string;
}
interface ExtendedConfig extends Config {}
type NestedConfigs = Array<ExtendedConfig | NestedConfigs>;
const configs: NestedConfigs[] = [];
const flattened = configs.flat(Infinity);
π Actual behavior
TypeScript raises the following error for the configs.flat(Infinity)
call:
Type instantiation is excessively deep and possibly infinite. ts(2589)
π Expected behavior
No error should be raised.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment