Skip to content

Commit 462279c

Browse files
committed
Refactor OrderingConstraint
Make sure cycles are detected and avoided in OrderingConstraint itself
1 parent 9ebdac4 commit 462279c

File tree

2 files changed

+151
-144
lines changed

2 files changed

+151
-144
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ abstract class Constraint extends Showable {
151151
def & (other: Constraint, otherHasErrors: Boolean)(implicit ctx: Context): Constraint
152152

153153
/** Check that no constrained parameter contains itself as a bound */
154-
def checkNonCyclic()(implicit ctx: Context): Unit
154+
def checkNonCyclic()(implicit ctx: Context): this.type
155155

156156
/** Check that constraint only refers to TypeParamRefs bound by itself */
157157
def checkClosed()(implicit ctx: Context): Unit

0 commit comments

Comments
 (0)