aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/TreeTypeMap.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-08-24 18:04:22 +0200
committerMartin Odersky <odersky@gmail.com>2014-08-24 18:09:01 +0200
commitaa7a0399ad5424dd5292f2f1941c7293c16d6b79 (patch)
treefcc3efccc01f6d5160774c0b3998481f2d492500 /src/dotty/tools/dotc/ast/TreeTypeMap.scala
parent70abd73e9306eca3ec4de1d98b877e4fafe66ad0 (diff)
downloaddotty-aa7a0399ad5424dd5292f2f1941c7293c16d6b79.tar.gz
dotty-aa7a0399ad5424dd5292f2f1941c7293c16d6b79.tar.bz2
dotty-aa7a0399ad5424dd5292f2f1941c7293c16d6b79.zip
Check that idents don't assume magic.
In TreeChecker, make sure that every identifier has a type with an elidable prefix. This excludes identifiers pointing to members of random prefixes without making the prefix explicit in the tree as part of a Select node.
Diffstat (limited to 'src/dotty/tools/dotc/ast/TreeTypeMap.scala')
-rw-r--r--src/dotty/tools/dotc/ast/TreeTypeMap.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/ast/TreeTypeMap.scala b/src/dotty/tools/dotc/ast/TreeTypeMap.scala
index 77ed24511..a66932e7b 100644
--- a/src/dotty/tools/dotc/ast/TreeTypeMap.scala
+++ b/src/dotty/tools/dotc/ast/TreeTypeMap.scala
@@ -48,6 +48,8 @@ final class TreeTypeMap(
cpy.Template(impl)(constr1, parents1, self1, body1).withType(tmap.mapType(impl.tpe))
case tree1 =>
tree1.withType(mapType(tree1.tpe)) match {
+ case id: Ident if tpd.needsSelect(id.tpe) =>
+ ref(id.tpe.asInstanceOf[TermRef]).withPos(id.pos)
case ddef @ DefDef(mods, name, tparams, vparamss, tpt, rhs) =>
val (tmap1, tparams1) = transformDefs(ddef.tparams)
val (tmap2, vparamss1) = tmap1.transformVParamss(vparamss)