diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-20 10:06:31 +0100 |
---|---|---|
committer | Tobias Schlatter <tobias@meisch.ch> | 2014-03-21 11:28:30 +0100 |
commit | 7e1343e86a0d2575d596198d0f889b7d64cdb5a4 (patch) | |
tree | 20eec46b99b6f025d4644cbbb2422f361443e7fe /src/dotty/tools/dotc/core/Types.scala | |
parent | 0dda8a1858c162f74f76a1d4dae158e99a250267 (diff) | |
download | dotty-7e1343e86a0d2575d596198d0f889b7d64cdb5a4.tar.gz dotty-7e1343e86a0d2575d596198d0f889b7d64cdb5a4.tar.bz2 dotty-7e1343e86a0d2575d596198d0f889b7d64cdb5a4.zip |
Refactored lookupRefined
Turned parameter into receiver (reciever was not used before at all).
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 38c07d99a..e9c3c56b2 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -625,11 +625,11 @@ object Types { * * to just U */ - def lookupRefined(pre: Type, name: Name)(implicit ctx: Context): Type = pre.stripTypeVar match { + def lookupRefined(name: Name)(implicit ctx: Context): Type = stripTypeVar match { case pre: RefinedType => - if (pre.refinedName ne name) lookupRefined(pre.parent, name) + if (pre.refinedName ne name) pre.parent.lookupRefined(name) else pre.refinedInfo match { - case TypeBounds(lo, hi) if lo eq hi => hi + case TypeBounds(lo, hi) /*if lo eq hi*/ => hi case _ => NoType } case pre: WildcardType => @@ -643,7 +643,7 @@ object Types { case name: TermName => TermRef(this, name) case name: TypeName => - val res = lookupRefined(this, name) + val res = lookupRefined(name) if (res.exists) res else TypeRef(this, name) } @@ -652,7 +652,7 @@ object Types { case name: TermName => TermRef(this, name, denot) case name: TypeName => - val res = lookupRefined(this, name) + val res = lookupRefined(name) if (res.exists) res else TypeRef(this, name, denot) } @@ -660,7 +660,7 @@ object Types { def select(sym: Symbol)(implicit ctx: Context): Type = if (sym.isTerm) TermRef(this, sym.asTerm) else { - val res = lookupRefined(this, sym.name) + val res = lookupRefined(sym.name) if (res.exists) res else TypeRef(this, sym.asType) } @@ -1114,7 +1114,7 @@ object Types { def derivedSelect(prefix: Type)(implicit ctx: Context): Type = if (prefix eq this.prefix) this else { - val res = lookupRefined(prefix, name) + val res = prefix.lookupRefined(name) if (res.exists) res else newLikeThis(prefix) } @@ -2299,7 +2299,7 @@ object Types { case tp: TypeRef => if (stopAtStatic && tp.symbol.isStatic) x else { - val tp1 = tp.lookupRefined(tp.prefix, tp.name) + val tp1 = tp.prefix.lookupRefined(tp.name) this(x, if (tp1.exists) tp1 else tp.prefix) } case tp: TermRef => |