aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Applications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-08-16 19:01:08 +0200
committerMartin Odersky <odersky@gmail.com>2013-08-16 19:01:08 +0200
commit502f426981105df448896f635ef559cd72787c43 (patch)
treeca3a85271ae10c7f697dd3e88b07b7045bf81e2e /src/dotty/tools/dotc/typer/Applications.scala
parentf540194f1b04c044c969772d5989d129264ea781 (diff)
downloaddotty-502f426981105df448896f635ef559cd72787c43.tar.gz
dotty-502f426981105df448896f635ef559cd72787c43.tar.bz2
dotty-502f426981105df448896f635ef559cd72787c43.zip
Various bugfixes for namer/typer/trees
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index 334e21ccb..439210af4 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -154,13 +154,13 @@ trait Applications extends Compatibility { self: Typer =>
/** The arguments re-ordered so that each named argument matches the
* same-named formal parameter.
*/
- val orderedArgs =
+ lazy val orderedArgs =
if (hasNamedArg(args))
reorder(args.asInstanceOf[List[untpd.Tree]]).asInstanceOf[List[Arg]]
else
args
- methType match {
+ protected def init() = methType match {
case methType: MethodType =>
// apply the result type constraint, unless method type is dependent
if (!methType.isDependent)
@@ -248,9 +248,9 @@ trait Applications extends Compatibility { self: Typer =>
def findDefault(cx: Context): Type = {
if (cx eq NoContext) NoType
else if (cx.scope != cx.outer.scope &&
- cx.lookup(methRef.name)
+ cx.denotsNamed(methRef.name)
.filterWithPredicate(_.symbol == meth).exists) {
- val denot = cx.lookup(getterName).toDenot(NoPrefix)
+ val denot = cx.denotsNamed(getterName).toDenot(NoPrefix)
NamedType(NoPrefix, getterName).withDenot(denot)
} else findDefault(cx.outer)
}
@@ -368,6 +368,7 @@ trait Applications extends Compatibility { self: Typer =>
def fail(msg: => String) =
ok = false
def normalizedFun = EmptyTree
+ init()
}
/** Subtrait of Application for the cases where arguments are (typed or
@@ -403,6 +404,7 @@ trait Applications extends Compatibility { self: Typer =>
private var typedArgBuf = new mutable.ListBuffer[Tree]
private var liftedDefs: mutable.ListBuffer[Tree] = null
private var myNormalizedFun: Tree = fun
+ init()
def addArg(arg: Tree, formal: Type): Unit =
typedArgBuf += adapt(arg, formal)