aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/VarianceChecker.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-08-10 17:48:52 +0200
committerMartin Odersky <odersky@gmail.com>2014-08-10 18:32:52 +0200
commitc2cdd3a3dca2a629923327046b213addd93499fc (patch)
treef893acbf9ab062c96c53d00215a6076f997e84b4 /src/dotty/tools/dotc/typer/VarianceChecker.scala
parentbbf777a729e5b6e8c8a75466c42004d3ff4c5d32 (diff)
downloaddotty-c2cdd3a3dca2a629923327046b213addd93499fc.tar.gz
dotty-c2cdd3a3dca2a629923327046b213addd93499fc.tar.bz2
dotty-c2cdd3a3dca2a629923327046b213addd93499fc.zip
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.
Diffstat (limited to 'src/dotty/tools/dotc/typer/VarianceChecker.scala')
-rw-r--r--src/dotty/tools/dotc/typer/VarianceChecker.scala3
1 files changed, 2 insertions, 1 deletions
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 =>