From c2cdd3a3dca2a629923327046b213addd93499fc Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 10 Aug 2014 17:48:52 +0200 Subject: More targeted eta-lifting Eta-lifting picked some arbitrary base type. It turned out that i94-nada failed once we add a product trait to case classes (in the next commit) because Eta-Kifting picked Product as the base type, even though the target type was bounded by Monad. We now change the scheme so that the target type is included in the lifting, in order to avoid that we lift to useless types. --- src/dotty/tools/dotc/typer/VarianceChecker.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/typer/VarianceChecker.scala') diff --git a/src/dotty/tools/dotc/typer/VarianceChecker.scala b/src/dotty/tools/dotc/typer/VarianceChecker.scala index 9ce3ca0b7..5865f0133 100644 --- a/src/dotty/tools/dotc/typer/VarianceChecker.scala +++ b/src/dotty/tools/dotc/typer/VarianceChecker.scala @@ -6,6 +6,7 @@ import core._ import Types._, Contexts._, Flags._, Symbols._, Annotations._, Trees._, NameOps._ import Decorators._ import Variances._ +import config.Printers.variances /** Provides `check` method to check that all top-level definitions * in tree are variance correct. Does not recurse inside methods. @@ -77,7 +78,7 @@ class VarianceChecker()(implicit ctx: Context) { * explicitly (their TypeDefs will be passed here.) For MethodTypes, the * same is true of the parameters (ValDefs). */ - def apply(status: Option[VarianceError], tp: Type): Option[VarianceError] = ctx.traceIndented(s"variance checking $tp of $base at $variance") { + def apply(status: Option[VarianceError], tp: Type): Option[VarianceError] = ctx.traceIndented(s"variance checking $tp of $base at $variance", variances) { if (status.isDefined) status else tp match { case tp: TypeRef => -- cgit v1.2.3