aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.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/Typer.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/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index b4e1335f8..6922111f4 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -268,11 +268,11 @@ class Typer extends Namer with Applications with Implicits {
}
// begin findRef
- if (ctx eq NoContext) previous
+ if (ctx.scope == null) previous
else {
val outer = ctx.outer
- if (ctx.scope ne outer.scope) {
- val defDenots = ctx.lookup(name)
+ if ((ctx.scope ne outer.scope) || (ctx.owner ne outer.owner)) {
+ val defDenots = ctx.denotsNamed(name)
if (defDenots.exists) {
val curOwner = ctx.owner
val pre = curOwner.thisType
@@ -299,6 +299,8 @@ class Typer extends Namer with Applications with Implicits {
}
// begin typedIdent
+ def kind = if (name.isTermName) "term" else "type" // !!! DEBUG
+ println(s"typed ident $kind $name in ${ctx.owner}")
if (ctx.mode is Mode.Pattern) {
if (name == nme.WILDCARD)
return tree.withType(pt)
@@ -369,7 +371,7 @@ class Typer extends Namer with Applications with Implicits {
case _ =>
val tpt1 = typedType(tree.tpt)
val cls = checkClassTypeWithStablePrefix(tpt1.tpe, tpt1.pos)
- checkInstantiatable(cls, tpt1.pos)
+ // todo in a later phase: checkInstantiatable(cls, tpt1.pos)
cpy.New(tree, tpt1).withType(tpt1.tpe)
}
@@ -594,7 +596,7 @@ class Typer extends Namer with Applications with Implicits {
assert(isFullyDefined(pt))
(EmptyTree, pt)
case original: DefDef =>
- val meth = ctx.lookup(original.name).first
+ val meth = symbolOfTree(original)
assert(meth.exists, meth)
(EmptyTree, meth.info.resultType)
case original =>
@@ -815,6 +817,7 @@ class Typer extends Namer with Applications with Implicits {
case tree: untpd.Import => typedImport(tree, sym)
case tree: untpd.PackageDef => typedPackageDef(tree)
case tree: untpd.Annotated => typedAnnotated(tree, pt)
+ case tree: untpd.TypedSplice => tree.tree
case untpd.EmptyTree => tpd.EmptyTree
case _ => typed(desugar(tree), pt)
}