@@ -1118,15 +1118,15 @@ object Types {
1118
1118
1119
1119
/** Widen this type and if the result contains embedded union types, replace
1120
1120
* 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.
1122
1122
* If an embedded union is found, we first try to simplify or eliminate it by
1123
1123
* re-lubbing it while allowing type parameters to be constrained further.
1124
1124
* Any remaining union types are replaced by their joins.
1125
1125
*
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
+ *
1130
1130
* is approximated by constraining `A` to be =:= to `Int` and returning `ArrayBuffer[Int]`
1131
1131
* instead of `ArrayBuffer[? >: Int | A <: Int & A]`
1132
1132
*
@@ -1155,6 +1155,8 @@ object Types {
1155
1155
tp.derivedRefinedType(tp.parent.widenUnion, tp.refinedName, tp.refinedInfo)
1156
1156
case tp : RecType =>
1157
1157
tp.rebind(tp.parent.widenUnion)
1158
+ case tp : HKTypeLambda =>
1159
+ tp.derivedLambdaType(resType = tp.resType.widenUnion)
1158
1160
case tp =>
1159
1161
tp
1160
1162
}
0 commit comments