diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-03-18 19:50:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-18 19:50:16 +0100 |
commit | 215c13408f7709c416baf561c513159622f10ba5 (patch) | |
tree | a186ebcfd2bc648b1e3f7cf9b58dbba57e5cd88a /compiler/src/dotty/tools | |
parent | 3ec16c78bd8a90f1205bb9047969ab3fd9e8dd75 (diff) | |
parent | 675892a4aaa77a4e71faa6057b4a0a059acb408d (diff) | |
download | dotty-215c13408f7709c416baf561c513159622f10ba5.tar.gz dotty-215c13408f7709c416baf561c513159622f10ba5.tar.bz2 dotty-215c13408f7709c416baf561c513159622f10ba5.zip |
Merge pull request #2110 from dotty-staging/fix/reduce-more-lambdas
Reduce type lambdas even if variance changes
Diffstat (limited to 'compiler/src/dotty/tools')
3 files changed, 6 insertions, 4 deletions
diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 40e2b083b..318295751 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -64,6 +64,7 @@ class ScalaSettings extends Settings.SettingGroup { val Ycheck = PhasesSetting("-Ycheck", "Check the tree at the end of") val YcheckMods = BooleanSetting("-Ycheck-mods", "Check that symbols and their defining trees have modifiers in sync") val debug = BooleanSetting("-Ydebug", "Increase the quantity of debugging output.") + val debugAlias = BooleanSetting("-Ydebug-alias", "Never follow alias when printing types") val debugNames = BooleanSetting("-YdebugNames", "Show name-space indicators when printing names") val debugTrace = BooleanSetting("-Ydebug-trace", "Trace core operations") val debugFlags = BooleanSetting("-Ydebug-flags", "Print all flags of definitions") diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index c713cd542..ba3e6a461 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -1,4 +1,5 @@ -package dotty.tools.dotc +package dotty.tools +package dotc package core import Types._ @@ -412,8 +413,8 @@ class TypeApplications(val self: Type) extends AnyVal { val followAlias = Config.simplifyApplications && { dealiased.resType match { case AppliedType(tyconBody, _) => - variancesConform(typParams, tyconBody.typeParams) - // Reducing is safe for type inference, as kind of type constructor does not change + sameLength(dealiased.typeParams, tyconBody.typeParams) + // Reducing is safe for type inference, as kind arity of type constructor does not change case _ => false } } diff --git a/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala index 3d952f425..8a33472b8 100644 --- a/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -130,7 +130,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { if (defn.isTupleClass(cls)) return toTextTuple(args) return (toTextLocal(tycon) ~ "[" ~ Text(args map argText, ", ") ~ "]").close case tp: TypeRef => - val hideType = tp.symbol is AliasPreferred + val hideType = !ctx.settings.debugAlias.value && (tp.symbol is AliasPreferred) if (hideType && !ctx.phase.erasedTypes && !tp.symbol.isCompleting) { tp.info match { case TypeAlias(alias) => return toText(alias) |