You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The same calls to funcNotUsingTupleType and funcUsingTupleType have different inferred typyings, even when they are evaluating the same thing.
π Expected behavior
The same calls to funcNotUsingTupleType and funcUsingTupleType to have the same inferred typyings.
The text was updated successfully, but these errors were encountered:
188599
changed the title
Same type evaluated differently when in conjunction with a Tuple or by itself
Same type evaluated differently when in a Tuple or by itself
Jan 24, 2022
In the first case, because TypeWithoutTuple is just a tuple type, we can safely collect inference candidates based on the tuple positions.
In the second case, TypeWithTuple has the possibility of T, so it's not safe to collect inference candidates from the tuple positions, so instead the type of the array literal gets computed (and reduced to { }, since we can't see at this point that {} is supposed to be a Partial<A>).
This might be solved with #30134 but in general an inference onto type S<T> = T | U<T> is not going to be able to produce as good as inference as one without it.
Bug Report
π Search Terms
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
Considering the following code:
π Actual behavior
The same calls to
funcNotUsingTupleType
andfuncUsingTupleType
have different inferred typyings, even when they are evaluating the same thing.π Expected behavior
The same calls to
funcNotUsingTupleType
andfuncUsingTupleType
to have the same inferred typyings.The text was updated successfully, but these errors were encountered: