Closed
Description
openedon Oct 19, 2020
TypeScript Version: 4.0.2 (and 4.1.0-dev.20201015)
Search Terms: circularly, Record
Code
type T1 = { [key: string]: T1 }
type T2 = Record<string, T2>
Expected behavior:
No compilation errors
Actual behavior:
While type T1 compiles properly, type T2 reports Type alias 'T2' circularly references itself.
even though they are inherently the same type. This was actually found by autofixing a new @typescript-eslint rule consistent-indexed-object-style
Playground Link: https://www.typescriptlang.org/play?ts=4.0.2#code/C4TwDgpgBAKgjFAvFA3lA2gawiAXFAZ2ACcBLAOwHMBdfeKAXwFgAoUSWAJiSgCUIAxgHtiAEwA8RMlQA0XAHxA
Related Issues: None found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment