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
{{ message }}
Repository navigation
Weird behavior with generics in generic tuple types #41857
Expected behavior:
Once S is provided, The 'act' function should automatically infer the specific type of S, which is constant for every element of the tuple type (I), and make the 'shape' parameter typesafe.
This behavior works correctly when:
// Without tuple typetypeAct<Sextendsobject>={act<Iextendsobject>(
...intentions: ((shape: S)=>I)[]): Act<S>&S&I;};
Actual behavior:
S is inferred as object, instead of its specific type. The return type is inferred correctly.
We don't support anything that involves UnionToIntersection; this is an ill-defined and will frequently produce "surprising" results.
I don't understand what you mean by "S is inferred as object" - it's just a type parameter. It sounds like you're referring to some specific instantiation of Act but there's just declarations in the repro?
Activity
RyanCavanaugh commentedon Dec 7, 2020
We don't support anything that involves
UnionToIntersection; this is an ill-defined and will frequently produce "surprising" results.I don't understand what you mean by "S is inferred as object" - it's just a type parameter. It sounds like you're referring to some specific instantiation of
Actbut there's just declarations in the repro?