@@ -1118,15 +1118,15 @@ object Types {
11181118
11191119 /** Widen this type and if the result contains embedded union types, replace
11201120 * them by their joins.
1121- * "Embedded" means: inside intersectons or recursive types, or in prefixes of refined types.
1121+ * "Embedded" means: inside type lambdas, intersections or recursive types, or in prefixes of refined types.
11221122 * If an embedded union is found, we first try to simplify or eliminate it by
11231123 * re-lubbing it while allowing type parameters to be constrained further.
11241124 * Any remaining union types are replaced by their joins.
11251125 *
1126- * For instance, if `A` is an unconstrained type variable, then
1127- *
1128- * ArrayBuffer[Int] | ArrayBuffer[A]
1129- *
1126+ * For instance, if `A` is an unconstrained type variable, then
1127+ *
1128+ * ArrayBuffer[Int] | ArrayBuffer[A]
1129+ *
11301130 * is approximated by constraining `A` to be =:= to `Int` and returning `ArrayBuffer[Int]`
11311131 * instead of `ArrayBuffer[? >: Int | A <: Int & A]`
11321132 *
@@ -1155,6 +1155,8 @@ object Types {
11551155 tp.derivedRefinedType(tp.parent.widenUnion, tp.refinedName, tp.refinedInfo)
11561156 case tp : RecType =>
11571157 tp.rebind(tp.parent.widenUnion)
1158+ case tp : HKTypeLambda =>
1159+ tp.derivedLambdaType(resType = tp.resType.widenUnion)
11581160 case tp =>
11591161 tp
11601162 }
0 commit comments