diff options
author | Martin Odersky <odersky@gmail.com> | 2016-06-29 19:12:29 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 13:34:59 +0200 |
commit | 5daae278392ed6fabd45c9fa55aded970ca2a348 (patch) | |
tree | 3ddec4b259a4c359efdff5fa4392a88819d336fe /src/dotty/tools/dotc/printing | |
parent | 4bf43f82c88dbeb0578e289b37ce1a7580aa22f2 (diff) | |
download | dotty-5daae278392ed6fabd45c9fa55aded970ca2a348.tar.gz dotty-5daae278392ed6fabd45c9fa55aded970ca2a348.tar.bz2 dotty-5daae278392ed6fabd45c9fa55aded970ca2a348.zip |
Multiple fixes
- Swap order of tests in lookupRefined
- Change joins of BindingKinds.
A type parameter joint with a normal refinement represents
a type parameter that has been filled in. So the Binding attribute
should be removed.
- Fix printing of type lambdas under new hk scheme
- refine isRef for hk type
The new definition avoids that a higher-kinded type "isRef"
of an underlying class. I.e. `[X] -> Any` is not longer a ref
to `Any`.
- Fix withBindingKind for type aliases
Old definition converted aliases to type bounds.
- Multiple fixes to BetaReduce
- Fix logic for hk subtype tests
- Make isHK more precise
Diffstat (limited to 'src/dotty/tools/dotc/printing')
-rw-r--r-- | src/dotty/tools/dotc/printing/RefinedPrinter.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/src/dotty/tools/dotc/printing/RefinedPrinter.scala index b5bc17c0c..61e29982b 100644 --- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -12,6 +12,7 @@ import typer.ProtoTypes.{SelectionProto, ViewProto, FunProto, IgnoredProto, dumm import Trees._ import TypeApplications._ import Decorators._ +import config.Config import scala.annotation.switch import language.implicitConversions @@ -117,9 +118,11 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { if (defn.isTupleClass(cls)) return toTextTuple(args) return (toTextLocal(tycon) ~ "[" ~ Text(args map argText, ", ") ~ "]").close case tp @ TypeLambda(argBoundss, body) => - val variances = tp.classSymbol.typeParams.map(_.variance) + val variances = + if (Config.newHK) argBoundss.map(b => BindingKind.toVariance(b.bindingKind)) + else tp.classSymbol.typeParams.map(_.variance) val prefix = ((('X' - 'A') + lambdaNestingLevel) % 26 + 'A').toChar - val paramNames = variances.indices.toList.map(prefix.toString + _) + val paramNames = argBoundss.indices.toList.map(prefix.toString + _) val instantiate = new TypeMap { def contains(tp1: Type, tp2: Type): Boolean = tp1.eq(tp2) || { |