Skip to content

Commit 04e9c0a

Browse files
dwijnandtgodzik
authored andcommitted
Document enum value changes in provablyDisjointClasses
1 parent 6b2eca3 commit 04e9c0a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2772,11 +2772,11 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
27722772
*
27732773
* 1. Single inheritance of classes
27742774
* 2. Final classes cannot be extended
2775-
* 3. ConstantTypes with distinct values are non intersecting
2776-
* 4. TermRefs with distinct values are non intersecting
2775+
* 3. ConstantTypes with distinct values are non-intersecting
2776+
* 4. TermRefs with distinct values are non-intersecting
27772777
* 5. There is no value of type Nothing
27782778
*
2779-
* Note on soundness: the correctness of match types relies on on the
2779+
* Note on soundness: the correctness of match types relies on the
27802780
* property that in all possible contexts, the same match type expression
27812781
* is either stuck or reduces to the same case.
27822782
*/

docs/_spec/03-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ The following properties hold about ´⌈X⌉´ (we have paper proofs for those)
10711071
The "lower-bound rule" states that ´S <: T´ if ´T = q.X´ and ´q.X´ is a non-class type designator and ´S <: L´ where ´L´ is the lower bound of the underlying type definition of ´q.X´".
10721072
That rule is known to break transitivy of subtyping in Scala already.
10731073

1074-
Second, we define the relation ´⋔´ on *classes* (including traits and hidden classes of objects) as:
1074+
Second, we define the relation ´⋔´ on *classes* (including traits, hidden classes of objects, and enum terms) as:
10751075

10761076
- ´C ⋔ D´ if `´C ∉´ baseClasses´(D)´` and ´D´ is `final`
10771077
- ´C ⋔ D´ if `´D ∉´ baseClasses´(C)´` and ´C´ is `final`

0 commit comments

Comments
 (0)