TypeScript Version: 4.0.2 (and 4.1.0-dev.20201015)
Search Terms: circularly, Record
Code
typeT1={[key: string]: T1}typeT2=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 (@typescript-eslint) rule consistent-indexed-object-style
Playground Link:https://www.typescriptlang.org/play?ts=4.0.2#code/C4TwDgpgBAKgjFAvFA3lA2gawiAXFAZ2ACcBLAOwHMBdfeKAXwFgAoUSWAJiSgCUIAxgHtiAEwA8RMlQA0XAHxA
Related Issues: None found
TypeScript Version: 4.0.2 (and 4.1.0-dev.20201015)
Search Terms: circularly, Record
Code
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 (@typescript-eslint) rule consistent-indexed-object-stylePlayground Link:https://www.typescriptlang.org/play?ts=4.0.2#code/C4TwDgpgBAKgjFAvFA3lA2gawiAXFAZ2ACcBLAOwHMBdfeKAXwFgAoUSWAJiSgCUIAxgHtiAEwA8RMlQA0XAHxA
Related Issues: None found