aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeOps.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-01-27 14:55:17 +0100
committerMartin Odersky <odersky@gmail.com>2013-01-27 14:55:17 +0100
commita7ef4380d97a32e00d8ab23eeafa0bedfbc97838 (patch)
tree03b8f133de95dbff549e6da9f293441bf369041f /src/dotty/tools/dotc/core/TypeOps.scala
parentd9a37eaf5d36d772d59bca81237c19b3eb11db42 (diff)
downloaddotty-a7ef4380d97a32e00d8ab23eeafa0bedfbc97838.tar.gz
dotty-a7ef4380d97a32e00d8ab23eeafa0bedfbc97838.tar.bz2
dotty-a7ef4380d97a32e00d8ab23eeafa0bedfbc97838.zip
Simplified RefinedTypes, keeping only the unary variant.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala
index 08d7c0cd6..25c8625ec 100644
--- a/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/src/dotty/tools/dotc/core/TypeOps.scala
@@ -44,18 +44,11 @@ trait TypeOps { this: Context =>
toPrefix(pre, clazz, thisclazz)
case _: BoundType | NoPrefix =>
tp
- case tp: RefinedType1 =>
- tp.derivedRefinedType1(
+ case tp: RefinedType =>
+ tp.derivedRefinedType(
asSeenFrom(tp.parent, pre, clazz, theMap),
- tp.name1,
- asSeenFrom(tp.info1, pre, clazz, theMap))
- case tp: RefinedType2 =>
- tp.derivedRefinedType2(
- asSeenFrom(tp.parent, pre, clazz, theMap),
- tp.name1,
- asSeenFrom(tp.info1, pre, clazz, theMap),
- tp.name2,
- asSeenFrom(tp.info2, pre, clazz, theMap))
+ tp.name,
+ asSeenFrom(tp.info, pre, clazz, theMap))
case _ =>
(if (theMap != null) theMap else new AsSeenFromMap(pre, clazz))
.mapOver(tp)
@@ -73,11 +66,6 @@ trait TypeOps { this: Context =>
case OrType(l, r) => isAbstractIntersection(l) & isAbstractIntersection(r)
case _ => false
}
- def containsName(names: Set[Name], tp: RefinedType): Boolean = tp match {
- case tp: RefinedType1 => names contains tp.name1
- case tp: RefinedType2 => (names contains tp.name1) || (names contains tp.name2)
- case _ => tp.names exists (names contains)
- }
def test = {
tp match {
case ThisType(_) =>
@@ -85,7 +73,7 @@ trait TypeOps { this: Context =>
case tp: RefinedType =>
tp.parent.isVolatile ||
isAbstractIntersection(tp.parent) &&
- containsName(tp.abstractMemberNames(tp), tp)
+ (tp.abstractMemberNames(tp) contains tp.name)
case tp: TypeProxy =>
tp.underlying.isVolatile
case AndType(l, r) =>