Skip to content

Commit bf7356e

Browse files
committed
Update comment
1 parent bccbaf7 commit bf7356e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,11 @@ trait ConstraintHandling {
512512
* 1. If `inst` is a singleton type, or a union containing some singleton types,
513513
* widen (all) the singleton type(s), provided the result is a subtype of `bound`.
514514
* (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).
517520
* 3. Widen some irreducible applications of higher-kinded types to wildcard arguments
518521
* (see @widenIrreducible).
519522
* 4. Drop transparent traits from intersections (see @dropTransparentTraits).

0 commit comments

Comments
 (0)