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
@@ -18683,44 +18678,33 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
18683
18678
let combinedMapper: TypeMapper | undefined;
18684
18679
if (root.inferTypeParameters) {
18685
18680
// When we're looking at making an inference for an infer type, when we get its constraint, it'll automagically be
18686
-
// instantiated with the context, so it doesn't need the mapper for the inference contex - however the constraint
18681
+
// instantiated with the context, so it doesn't need the mapper for the inference context - however the constraint
18687
18682
// may refer to another _root_, _uncloned_ `infer` type parameter [1], or to something mapped by `mapper` [2].
18688
18683
// [1] Eg, if we have `Foo<T, U extends T>` and `Foo<number, infer B>` - `B` is constrained to `T`, which, in turn, has been instantiated
18689
18684
// as `number`
18690
18685
// Conversely, if we have `Foo<infer A, infer B>`, `B` is still constrained to `T` and `T` is instantiated as `A`
18691
18686
// [2] Eg, if we have `Foo<T, U extends T>` and `Foo<Q, infer B>` where `Q` is mapped by `mapper` into `number` - `B` is constrained to `T`
18692
18687
// which is in turn instantiated as `Q`, which is in turn instantiated as `number`.
18693
18688
// So we need to:
18694
-
// * Clone the type parameters so their constraints can be instantiated in the context of `mapper` (otherwise theyd only get inference context information)
18695
-
// * Set the clones to both map the conditional's enclosing `mapper` and the original params
18696
-
// * instantiate the extends type with the clones
18689
+
// * combine `context.nonFixingMapper` with `mapper` so their constraints can be instantiated in the context of `mapper` (otherwise they'd only get inference context information)
18697
18690
// * incorporate all of the component mappers into the combined mapper for the true and false members
18698
-
// This means we have three mappers that need applying:
18691
+
// This means we have two mappers that need applying:
18699
18692
// * The original `mapper` used to create this conditional
18700
-
// * The mapper that maps the old root type parameter to the clone (`freshMapper`)
18701
-
// * The mapper that maps the clone to its inference result (`context.mapper`)
0 commit comments