diff options
author | Martin Odersky <odersky@gmail.com> | 2016-06-29 09:50:27 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 13:35:06 +0200 |
commit | 6bd7ba9ea4484ee2065dd16077cba6c26b2050d9 (patch) | |
tree | 7b13e292f072fed02e0ba9a8a431eef92f71cf57 /src/dotty/tools/dotc/printing | |
parent | a23c1a476296a25566d7aa08de676a1217b243cb (diff) | |
download | dotty-6bd7ba9ea4484ee2065dd16077cba6c26b2050d9.tar.gz dotty-6bd7ba9ea4484ee2065dd16077cba6c26b2050d9.tar.bz2 dotty-6bd7ba9ea4484ee2065dd16077cba6c26b2050d9.zip |
Remove refinement encoding of hk types
Remove the code that implemented the encoding of hk types
using refinements.
Drop the notion that RefinedTypes can be type parameters. This is
no longer true under the new representation.
Also, refactoring MemberBinding -> TypeParamInfo
Diffstat (limited to 'src/dotty/tools/dotc/printing')
-rw-r--r-- | src/dotty/tools/dotc/printing/PlainPrinter.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/printing/RefinedPrinter.scala | 30 |
2 files changed, 0 insertions, 32 deletions
diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala index 880804b9e..656650d91 100644 --- a/src/dotty/tools/dotc/printing/PlainPrinter.scala +++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala @@ -51,8 +51,6 @@ class PlainPrinter(_ctx: Context) extends Printer { homogenize(tp1) & homogenize(tp2) case OrType(tp1, tp2) => homogenize(tp1) | homogenize(tp2) - case tp: RefinedType if !Config.newHK => - tp.normalizeHkApplyOLD case tp: SkolemType => homogenize(tp.info) case tp: LazyRef => diff --git a/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/src/dotty/tools/dotc/printing/RefinedPrinter.scala index c772267e7..34456d0b9 100644 --- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -113,36 +113,6 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { if (defn.isFunctionClass(cls)) return toTextFunction(args) if (defn.isTupleClass(cls)) return toTextTuple(args) return (toTextLocal(tycon) ~ "[" ~ Text(args map argText, ", ") ~ "]").close - case tp @ TypeLambdaOLD(argBoundss, body) => - val variances = argBoundss.map(b => BindingKind.toVariance(b.bindingKind)) - val prefix = ((('X' - 'A') + lambdaNestingLevel) % 26 + 'A').toChar - val paramNames = argBoundss.indices.toList.map(prefix.toString + _) - val instantiate = new TypeMap { - def contains(tp1: Type, tp2: Type): Boolean = - tp1.eq(tp2) || { - tp1.stripTypeVar match { - case tp1: RefinedOrRecType => contains(tp1.parent, tp2) - case _ => false - } - } - def apply(t: Type): Type = t match { - case TypeRef(RecThis(rt), name) if name.isHkArgNameOLD && contains(tp, rt) => - // Make up a name that prints as "Xi". Need to be careful we do not - // accidentally unique-hash to something else. That's why we can't - // use prefix = NoPrefix or a WithFixedSym instance. - TypeRef.withSymAndName( - defn.EmptyPackageClass.thisType, defn.AnyClass, - paramNames(name.hkArgIndexOLD).toTypeName) - case _ => - mapOver(t) - } - } - val instArgs = argBoundss.map(instantiate).asInstanceOf[List[TypeBounds]] - val instBody = instantiate(body).dropAlias - lambdaNestingLevel += 1 - try - return typeLambdaText(paramNames, variances, instArgs, instBody) - finally lambdaNestingLevel -=1 case tp: TypeRef => val hideType = tp.symbol is AliasPreferred if (hideType && !ctx.phase.erasedTypes && !tp.symbol.isCompleting) { |