Browse files

Special treatment for local symbols in TypeTreeMemberType

Avoids calling `thisType` on the owner if it is a term symbol,
which doesn't make much sense.

This method is used internally in tree factory methods that
create, e.g, a `DefDef` based on the info of a `Symbol`.
  • Loading branch information...
retronym committed Nov 20, 2013
1 parent b5be392 commit 5d5596bb07c0b5985fe9a6ba5433a3d463918b28
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/reflect/scala/reflect/internal/Trees.scala
@@ -590,7 +590,7 @@ trait Trees extends api.Trees {
def TypeTree(tp: Type): TypeTree = TypeTree() setType tp
private def TypeTreeMemberType(sym: Symbol): TypeTree = {
// Needed for pos/t4970*.scala. See SI-7853
- val resType = (sym.owner.thisType memberType sym).finalResultType
+ val resType = (if (sym.isLocal) sym.tpe else (sym.owner.thisType memberType sym)).finalResultType

0 comments on commit 5d5596b

Please sign in to comment.