Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tsc/internal/checker/nodebuilderimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -3135,6 +3135,10 @@ func (b *NodeBuilderImpl) typeReferenceToTypeNode(t *Type) *ast.TypeNode {
}

func (b *NodeBuilderImpl) visitAndTransformType(t *Type, transform func(b *NodeBuilderImpl, t *Type) *ast.TypeNode) *ast.TypeNode {
if b.checkTruncationLength() {
return b.createElidedInformationPlaceholder()
}

typeId := t.id
isConstructorObject := t.objectFlags&ObjectFlagsAnonymous != 0 && t.symbol != nil && t.symbol.Flags&ast.SymbolFlagsClass != 0
var id *CompositeSymbolIdentity
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -536,5 +536,5 @@ type DeeplyMapped/*6*/ = {[K in keyof Foo]: {[K2 in keyof Foo]: [K, K2, Foo[K],
f.GoToMarker(t, "5")
f.VerifyQuickInfoIs(t, "type LongTuple = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17.18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70]", "")
f.GoToMarker(t, "6")
f.VerifyQuickInfoIs(t, "type DeeplyMapped = {\n _0: {\n _0: [\"_0\", \"_0\", 0, 0];\n _1: [\"_0\", \"_1\", 0, 1];\n _2: [\"_0\", \"_2\", 0, 2];\n _3: [\"_0\", \"_3\", 0, 3];\n _4: [\"_0\", \"_4\", 0, 4];\n _5: [\"_0\", \"_5\", 0, 5];\n _6: [\"_0\", \"_6\", 0, 6];\n _7: [\"_0\", \"_7\", 0, 7];\n _8: [\"_0\", \"_8\", 0, 8];\n _9: [\"_0\", \"_9\", 0, 9];\n _10: [\"_0\", \"_10\", 0, 10];\n _11: [\"_0\", \"_11\", 0, 11];\n _12: [\"_0\", \"_12\", 0, 12];\n _13: [\"_0\", \"_13\", 0, 13];\n _14: [\"_0\", \"_14\", 0, 14];\n _15: [\"_0\", \"_15\", 0, 15];\n _16: [\"_0\", \"_16\", 0, 16];\n _17: [\"_0\", \"_17\", 0, 17];\n _18: [\"_0\", \"_18\", 0, 18];\n _19: [\"_0\", \"_19\", 0, 19];\n _20: [\"_0\", \"_20\", 0, 20];\n _21: [\"_0\", \"_21\", 0, 21];\n ... 477 more ...;\n _499: [...];\n };\n ... 498 more ...;\n _499: {\n ...;\n };\n}", "")
f.VerifyQuickInfoIs(t, "type DeeplyMapped = {\n _0: {\n _0: [\"_0\", \"_0\", 0, 0];\n _1: [\"_0\", \"_1\", 0, 1];\n _2: [\"_0\", \"_2\", 0, 2];\n _3: [\"_0\", \"_3\", 0, 3];\n _4: [\"_0\", \"_4\", 0, 4];\n _5: [\"_0\", \"_5\", 0, 5];\n _6: [\"_0\", \"_6\", 0, 6];\n _7: [\"_0\", \"_7\", 0, 7];\n _8: [\"_0\", \"_8\", 0, 8];\n _9: [\"_0\", \"_9\", 0, 9];\n _10: [\"_0\", \"_10\", 0, 10];\n _11: [\"_0\", \"_11\", 0, 11];\n _12: [\"_0\", \"_12\", 0, 12];\n _13: [\"_0\", \"_13\", 0, 13];\n _14: [\"_0\", \"_14\", 0, 14];\n _15: [\"_0\", \"_15\", 0, 15];\n _16: [\"_0\", \"_16\", 0, 16];\n _17: [\"_0\", \"_17\", 0, 17];\n _18: [\"_0\", \"_18\", 0, 18];\n _19: [\"_0\", \"_19\", 0, 19];\n _20: [\"_0\", \"_20\", 0, 20];\n _21: [\"_0\", \"_21\", 0, 21];\n ... 477 more ...;\n _499: [...];\n };\n ... 498 more ...;\n _499: ...;\n}", "")
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
declarationEmitOversizedCachedType.ts(15,14): error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.


==== declarationEmitOversizedCachedType.ts (1 errors) ====
let x0 = { v: 1 };
let x1 = { a: x0, b: x0, c: x0 };
let x2 = { a: x1, b: x1, c: x1 };
let x3 = { a: x2, b: x2, c: x2 };
let x4 = { a: x3, b: x3, c: x3 };
let x5 = { a: x4, b: x4, c: x4 };
let x6 = { a: x5, b: x5, c: x5 };
let x7 = { a: x6, b: x6, c: x6 };
let x8 = { a: x7, b: x7, c: x7 };
let x9 = { a: x8, b: x8, c: x8 };
let x10 = { a: x9, b: x9, c: x9 };
let x11 = { a: x10, b: x10, c: x10 };
let x12 = { a: x11, b: x11, c: x11 };
let x13 = { a: x12, b: x12, c: x12 };
export const y = x13;
~
!!! error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
unionElementErrorTruncation.ts(26,1): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | { ...; } | { ...; } | { ...; } | { ...; }'.
No index signature with a parameter of type 'string' was found on type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | { ...; } | { ...; } | { ...; } | { ...; }'.
unionElementErrorTruncation.ts(27,1): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | ... 4 more ... | { ...; }'.
No index signature with a parameter of type 'string' was found on type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | ... 4 more ... | { ...; }'.
unionElementErrorTruncation.ts(26,1): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | ... | ... | ... | ...'.
No index signature with a parameter of type 'string' was found on type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | ... | ... | ... | ...'.
unionElementErrorTruncation.ts(27,1): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | ... 4 more ... | ...'.
No index signature with a parameter of type 'string' was found on type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | ... 4 more ... | ...'.


==== unionElementErrorTruncation.ts (2 errors) ====
Expand Down Expand Up @@ -32,10 +32,10 @@ unionElementErrorTruncation.ts(27,1): error TS7053: Element implicitly has an 'a

o1[s];
~~~~~
!!! error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | { ...; } | { ...; } | { ...; } | { ...; }'.
!!! error TS7053: No index signature with a parameter of type 'string' was found on type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | { ...; } | { ...; } | { ...; } | { ...; }'.
!!! error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | ... | ... | ... | ...'.
!!! error TS7053: No index signature with a parameter of type 'string' was found on type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | ... | ... | ... | ...'.
o2[s];
~~~~~
!!! error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | ... 4 more ... | { ...; }'.
!!! error TS7053: No index signature with a parameter of type 'string' was found on type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | ... 4 more ... | { ...; }'.
!!! error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | ... 4 more ... | ...'.
!!! error TS7053: No index signature with a parameter of type 'string' was found on type '{ id: "00"; } | { id: "01"; } | { id: "02"; } | { id: "03"; } | { id: "04"; } | { id: "05"; } | { id: "06"; } | { id: "07"; } | { id: "08"; } | { id: "09"; } | { id: "10"; } | { id: "11"; } | { id: "12"; } | { id: "13"; } | { id: "14"; } | ... 4 more ... | ...'.

Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
// | nestedProp3: boolean;
// | nestedProp4: Date;
// | };
// | property20: () => void;
// | property20: ...;
// | }
// | ```
// |
Expand Down Expand Up @@ -171,7 +171,7 @@
"hover": {
"contents": {
"kind": "markdown",
"value": "```typescript\ninterface LargeInterface {\n property1: string;\n property2: number;\n property3: boolean;\n property4: Date;\n property5: string[];\n property6: number[];\n property7: boolean[];\n property8: {\n [key: string]: unknown;\n };\n property9: string | null;\n property10: number | null;\n property11: boolean | null;\n property12: Date | null;\n property13: string | number;\n property14: number | boolean;\n property15: string | boolean;\n property16: {\n id: number;\n name: string;\n }[];\n property17: {\n key: string;\n value: unknown;\n }[];\n property18: {\n nestedProp1: string;\n nestedProp2: number;\n };\n property19: {\n nestedProp3: boolean;\n nestedProp4: Date;\n };\n property20: () => void;\n}\n```\n"
"value": "```typescript\ninterface LargeInterface {\n property1: string;\n property2: number;\n property3: boolean;\n property4: Date;\n property5: string[];\n property6: number[];\n property7: boolean[];\n property8: {\n [key: string]: unknown;\n };\n property9: string | null;\n property10: number | null;\n property11: boolean | null;\n property12: Date | null;\n property13: string | number;\n property14: number | boolean;\n property15: string | boolean;\n property16: {\n id: number;\n name: string;\n }[];\n property17: {\n key: string;\n value: unknown;\n }[];\n property18: {\n nestedProp1: string;\n nestedProp2: number;\n };\n property19: {\n nestedProp3: boolean;\n nestedProp4: Date;\n };\n property20: ...;\n}\n```\n"
},
"range": {
"start": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
// | nestedProp3: boolean;
// | nestedProp4: Date;
// | };
// | property20: () => void;
// | property20: ...;
// | }
// | ```
// |
Expand Down Expand Up @@ -171,7 +171,7 @@
"hover": {
"contents": {
"kind": "markdown",
"value": "```typescript\ninterface LargeInterface {\n property1: string;\n property2: number;\n property3: boolean;\n property4: Date;\n property5: string[];\n property6: number[];\n property7: boolean[];\n property8: {\n [key: string]: unknown;\n };\n property9: string | null;\n property10: number | null;\n property11: boolean | null;\n property12: Date | null;\n property13: string | number;\n property14: number | boolean;\n property15: string | boolean;\n property16: {\n id: number;\n name: string;\n }[];\n property17: {\n key: string;\n value: unknown;\n }[];\n property18: {\n nestedProp1: string;\n nestedProp2: number;\n };\n property19: {\n nestedProp3: boolean;\n nestedProp4: Date;\n };\n property20: () => void;\n}\n```\n"
"value": "```typescript\ninterface LargeInterface {\n property1: string;\n property2: number;\n property3: boolean;\n property4: Date;\n property5: string[];\n property6: number[];\n property7: boolean[];\n property8: {\n [key: string]: unknown;\n };\n property9: string | null;\n property10: number | null;\n property11: boolean | null;\n property12: Date | null;\n property13: string | number;\n property14: number | boolean;\n property15: string | boolean;\n property16: {\n id: number;\n name: string;\n }[];\n property17: {\n key: string;\n value: unknown;\n }[];\n property18: {\n nestedProp1: string;\n nestedProp2: number;\n };\n property19: {\n nestedProp3: boolean;\n nestedProp4: Date;\n };\n property20: ...;\n}\n```\n"
},
"range": {
"start": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @declaration: true
// @noEmit: true
// @noTypesAndSymbols: true

let x0 = { v: 1 };
let x1 = { a: x0, b: x0, c: x0 };
let x2 = { a: x1, b: x1, c: x1 };
let x3 = { a: x2, b: x2, c: x2 };
let x4 = { a: x3, b: x3, c: x3 };
let x5 = { a: x4, b: x4, c: x4 };
let x6 = { a: x5, b: x5, c: x5 };
let x7 = { a: x6, b: x6, c: x6 };
let x8 = { a: x7, b: x7, c: x7 };
let x9 = { a: x8, b: x8, c: x8 };
let x10 = { a: x9, b: x9, c: x9 };
let x11 = { a: x10, b: x10, c: x10 };
let x12 = { a: x11, b: x11, c: x11 };
let x13 = { a: x12, b: x12, c: x12 };
export const y = x13;