-
Notifications
You must be signed in to change notification settings - Fork 42
Description
🐛 Bug Report
- TypeStat version: 0.8.1
- TypeScript version: 5.2
- Node version: 20
Actual Behavior
Grabbing one from the pile here, this isn't the only one, but the rest look similar:
diff --git a/lib/Models/SelectableDimensions/SelectableDimensions.ts b/lib/Models/SelectableDimensions/SelectableDimensions.ts
index b36326626..1747314a8 100644
--- a/lib/Models/SelectableDimensions/SelectableDimensions.ts
+++ b/lib/Models/SelectableDimensions/SelectableDimensions.ts
@@ -19,7 +19,7 @@ export interface EnumDimensionOption<T = string> {
}
export interface EnumDimension<T = string> extends Dimension {
- readonly options?: readonly EnumDimensionOption<T>[];
+ readonly options?: readonly EnumDimensionOption<T>[] | T | T;
readonly selectedId?: T;
readonly allowUndefined?: boolean;
/** If true, then the user can set the value to arbitrary text */I'm guessing this is related to #1447, but for a different type.
Expected Behavior
I'm not certain that the type on the interface originally is correct because TypeStat has found some similar type issues in other places (relating to promises), so it's quite possible that the interface should have the type EnumDimensionOption<T>[] | T. I expect TypeStat to stop adding | T after the first one is added though.
Is there a way to find the code point that caused TypeStat to add the type? I'm familiar with how Hindley-Milner type inference works, so I realize it might be hard to give a good code point, but a bad code point that at least was involved in constraining the type would still be better than the current "it's somewhere in the source code" black box.
Reproduction
Same as #2014.