aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/ProtoTypes.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-03-04 20:30:20 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-03-04 20:30:21 +0100
commit42f87c2cd4f704fcb5ea769a4dbc85c2d183ac12 (patch)
treee1573388d591717b72f07bf874038640fdd76240 /src/dotty/tools/dotc/typer/ProtoTypes.scala
parent5225f00ab3300bac62a467ecc532c275e02e7f43 (diff)
downloaddotty-42f87c2cd4f704fcb5ea769a4dbc85c2d183ac12.tar.gz
dotty-42f87c2cd4f704fcb5ea769a4dbc85c2d183ac12.tar.bz2
dotty-42f87c2cd4f704fcb5ea769a4dbc85c2d183ac12.zip
Allow adding typevars to an uncommitable constraint set
We triggered this assert after the fix in the previous commit.
Diffstat (limited to 'src/dotty/tools/dotc/typer/ProtoTypes.scala')
-rw-r--r--src/dotty/tools/dotc/typer/ProtoTypes.scala6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/ProtoTypes.scala b/src/dotty/tools/dotc/typer/ProtoTypes.scala
index 7997d1cf4..97b47b2bd 100644
--- a/src/dotty/tools/dotc/typer/ProtoTypes.scala
+++ b/src/dotty/tools/dotc/typer/ProtoTypes.scala
@@ -320,10 +320,8 @@ object ProtoTypes {
*/
def constrained(pt: PolyType, owningTree: untpd.Tree)(implicit ctx: Context): (PolyType, List[TypeVar]) = {
val state = ctx.typerState
- def howmany = if (owningTree.isEmpty) "no" else "some"
- def committable = if (ctx.typerState.isCommittable) "committable" else "uncommittable"
- assert(owningTree.isEmpty != ctx.typerState.isCommittable,
- s"inconsistent: $howmany typevars were added to $committable constraint ${state.constraint}")
+ assert(!(ctx.typerState.isCommittable && owningTree.isEmpty),
+ s"inconsistent: no typevars were added to committable constraint ${state.constraint}")
def newTypeVars(pt: PolyType): List[TypeVar] =
for (n <- (0 until pt.paramNames.length).toList)