diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/Matrix.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/Matrix.scala b/src/compiler/scala/tools/nsc/matching/Matrix.scala index 2c9d974d61..0bd9caf506 100644 --- a/src/compiler/scala/tools/nsc/matching/Matrix.scala +++ b/src/compiler/scala/tools/nsc/matching/Matrix.scala @@ -155,8 +155,12 @@ trait Matrix extends MatrixAdditions { // XXX how will valsym.tpe differ from sym.tpe ? def tpe = valsym.tpe - lazy val ident = ID(lhs) - lazy val valDef = tracing("typedVal", typer typedValDef (VAL(lhs) === rhs) setPos lhs.pos) + // See #1427 for an example of a crash which occurs unless we retype: + // in that instance there is an existential in the pattern. + lazy val ident = typer typed { ID(lhs) setType null } + lazy val valDef = typer typedValDef { + (VAL(lhs) withType ident.tpe) === rhs + } override def toString() = "%s: %s = %s".format(lhs, lhs.info, rhs) } |