Skip to content

Commit 42f87c2

Browse files
committed
Allow adding typevars to an uncommitable constraint set
We triggered this assert after the fix in the previous commit.
1 parent 5225f00 commit 42f87c2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/dotty/tools/dotc/typer/ProtoTypes.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,8 @@ object ProtoTypes {
320320
*/
321321
def constrained(pt: PolyType, owningTree: untpd.Tree)(implicit ctx: Context): (PolyType, List[TypeVar]) = {
322322
val state = ctx.typerState
323-
def howmany = if (owningTree.isEmpty) "no" else "some"
324-
def committable = if (ctx.typerState.isCommittable) "committable" else "uncommittable"
325-
assert(owningTree.isEmpty != ctx.typerState.isCommittable,
326-
s"inconsistent: $howmany typevars were added to $committable constraint ${state.constraint}")
323+
assert(!(ctx.typerState.isCommittable && owningTree.isEmpty),
324+
s"inconsistent: no typevars were added to committable constraint ${state.constraint}")
327325

328326
def newTypeVars(pt: PolyType): List[TypeVar] =
329327
for (n <- (0 until pt.paramNames.length).toList)

0 commit comments

Comments
 (0)