From eb0813b9ef437b9c89f8b67ae5b0070b300a0fc1 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 9 Dec 2013 18:29:51 +0100 Subject: Fixes to avoid stale symbols and to avoid methods as pattern constructors. --- src/dotty/tools/dotc/typer/Applications.scala | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Applications.scala') diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala index 5e56d9eb8..64f44ee5e 100644 --- a/src/dotty/tools/dotc/typer/Applications.scala +++ b/src/dotty/tools/dotc/typer/Applications.scala @@ -19,7 +19,6 @@ import ErrorReporting._ import Trees._ import Names._ import StdNames._ -import Constants._ import Inferencing._ import EtaExpansion._ import collection.mutable @@ -538,8 +537,7 @@ trait Applications extends Compatibility { self: Typer => errorTree(tree, s"${qual.show} cannot be used as an extractor in a pattern because it lacks an unapply or unapplySeq method") val unapply = { - val dummyArg = untpd.TypedSplice(dummyTreeOfType(WildcardType)) - val unappProto = FunProto(dummyArg :: Nil, WildcardType, this) + val unappProto = new UnapplyFunProto(this) tryEither { implicit ctx => typedExpr(untpd.Select(qual, nme.unapply), unappProto) } { @@ -755,9 +753,6 @@ trait Applications extends Compatibility { self: Typer => } } - private lazy val dummyTree = untpd.Literal(Constant(null)) - def dummyTreeOfType(tp: Type): Tree = dummyTree withTypeUnchecked tp - /** Resolve overloaded alternative `alts`, given expected type `pt`. * todo: use techniques like for implicits to pick candidates quickly? */ -- cgit v1.2.3