-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: 3.9.0+ (works in 3.8.x, broken in 3.9.x, 4.0.x)
Search Terms:
truncated, "...", declaration
Code
I'm still working on getting a scoped repro here, and will update this ticket when I have one. But – in TS 3.8 (and earlier), I have a complex type that produces the following code in a .d.ts file:
<-snip->
removed: (import("ts-json-validator/dist/json-schema").JsonValue[] & {
[k: string]: unknown;
}[]) | (import("ts-json-validator/dist/json-schema").JsonValue[] & {
[k: string]: unknown;
}[] & string) | (import("ts-json-validator/dist/json-schema").JsonValue[] & {
[k: string]: unknown;
}[] & number) | (import("ts-json-validator/dist/json-schema").JsonValue[] & {
[k: string]: unknown;
}[] & false) | (import("ts-json-validator/dist/json-schema").JsonValue[] & {
[k: string]: unknown;
}[] & true) | (import("ts-json-validator/dist/json-schema").JsonValue[] & {
[k: string]: unknown;
}[] & {
[property: string]: import("ts-json-validator/dist/json-schema").JsonValue;
}) | (import("ts-json-validator/dist/json-schema").JsonValue[] & {
[k: string]: unknown;
}[] & readonly import("ts-json-validator/dist/json-schema").JsonValue[]);
<-snip->
In 3.9+, this gets truncated as though we're in an editor environment:
removed: (import("ts-json-validator/dist/json-schema").JsonValue[] & {
[k: string]: unknown;
}[]) | (import("ts-json-validator/dist/json-schema").JsonValue[] & {
...;
}[] & string) | ... 4 more ... | (import("ts-json-validator/dist/json-schema").JsonValue[] & ... 1 more ... & readonly import("ts-json-validator/dist/json-schema").JsonValue[]);
Expected behavior:
Types aren't truncated in .d.ts files
Actual behavior:
Types are truncated, producing syntactically invalid .d.ts
files
Related Issues:
- Not directly related, but Setting noErrorTruncation to false truncates inferred type of variables/functions; which are not errors #26238 has some investigation about information placeholders
antoniusostermann, kevinbc0, lukasschwab, alex7229, ctumolosus and 1 more
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript