File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -512,8 +512,11 @@ trait ConstraintHandling {
512
512
* 1. If `inst` is a singleton type, or a union containing some singleton types,
513
513
* widen (all) the singleton type(s), provided the result is a subtype of `bound`.
514
514
* (i.e. `inst.widenSingletons <:< bound` succeeds with satisfiable constraint)
515
- * 2. If `inst` is a union type, approximate the union type from above by an intersection
516
- * of all common base types, provided the result is a subtype of `bound`.
515
+ * 2a. If `inst` is a union type and `widenUnions` is true, approximate the union type
516
+ * from above by an intersection of all common base types, provided the result
517
+ * is a subtype of `bound`.
518
+ * 2b. If `inst` is a union type and `widenUnions` is false, turn it into a hard
519
+ * union type (except for unions | Null, which are kept in the state they were).
517
520
* 3. Widen some irreducible applications of higher-kinded types to wildcard arguments
518
521
* (see @widenIrreducible).
519
522
* 4. Drop transparent traits from intersections (see @dropTransparentTraits).
You can’t perform that action at this time.
0 commit comments