From a7ef4380d97a32e00d8ab23eeafa0bedfbc97838 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 27 Jan 2013 14:55:17 +0100 Subject: Simplified RefinedTypes, keeping only the unary variant. --- src/dotty/tools/dotc/core/TypeOps.scala | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'src/dotty/tools/dotc/core/TypeOps.scala') 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) => -- cgit v1.2.3