@@ -216,12 +216,12 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
216
216
// In the algorithm below, we try to widen both sides (once), and then proceed as follows:
217
217
//
218
218
// 2.0. If no widening succeeds, proceed with step 3.
219
- // 2.1. If only one widening succeeds, pick that one.
220
- // 2.2. If the two widened types are in a subtype relationship, pick the smaller one.
221
- // 2.3. If exactly one of the two types is a singleton type, pick that one .
222
- // 2.4. If the widened tp2 is a supertype of tp1, pick widened tp2.
223
- // 2.5. If the widened tp1 is a supertype of tp2, pick widened tp1.
224
- // 2.6. Otherwise, pick widened tp1
219
+ // 2.1. If only one widening succeeds, continue with that one.
220
+ // 2.2. If the two widened types are in a subtype relationship, continue with the smaller one.
221
+ // 2.3. If exactly one of the two types is a singleton type, continue with the widened singleton type .
222
+ // 2.4. If the widened tp2 is a supertype of tp1, return widened tp2.
223
+ // 2.5. If the widened tp1 is a supertype of tp2, return widened tp1.
224
+ // 2.6. Otherwise, continue with widened tp1
225
225
//
226
226
// At steps 4-6 we lose possible solutions, since we have to make an
227
227
// arbitrary choice which side to widen. A better solution would look at
@@ -258,7 +258,8 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
258
258
else if (isSingle1 && ! isSingle2) orDominator(tp1w | tp2) // 2.3
259
259
else if (isSingle2 && ! isSingle1) orDominator(tp1 | tp2w) // 2.3
260
260
else if (tp1 frozen_<:< tp2w) tp2w // 2.4
261
- else orDominator(tp1w | tp2) // 2.5 and 2.6
261
+ else if (tp2 frozen_<:< tp1w) tp1w // 2.5
262
+ else orDominator(tp1w | tp2) // 2.6
262
263
}
263
264
}
264
265
0 commit comments