Bug: return type duplicate infinite amount: | T #2015
Labels
area: fixers
Around how TypeStat fixes code.
status: accepting prs
Please, send a pull request to resolve this! 🙏
type: bug
Something isn't working :( 🐛
🐛 Bug Report
Actual Behavior
Grabbing one from the pile here, this isn't the only one, but the rest look similar:
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.
The text was updated successfully, but these errors were encountered: