aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeApplications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-07-14 17:37:52 +0200
committerMartin Odersky <odersky@gmail.com>2015-09-18 18:05:15 +0200
commitfdf8f867fa1a1d2493052b19bd50907f1b5d75e8 (patch)
treeb4b6126e16a705000fc569a505b9c579314a7f5b /src/dotty/tools/dotc/core/TypeApplications.scala
parent0d95c76466012f9a7e6535ebba0620df4042f179 (diff)
downloaddotty-fdf8f867fa1a1d2493052b19bd50907f1b5d75e8.tar.gz
dotty-fdf8f867fa1a1d2493052b19bd50907f1b5d75e8.tar.bz2
dotty-fdf8f867fa1a1d2493052b19bd50907f1b5d75e8.zip
Fix argument eta expansion
... and move to TypeApplications. isLambda test was the wrong way before.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeApplications.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala
index f4f14101d..6d3b7ac47 100644
--- a/src/dotty/tools/dotc/core/TypeApplications.scala
+++ b/src/dotty/tools/dotc/core/TypeApplications.scala
@@ -540,6 +540,9 @@ class TypeApplications(val self: Type) extends AnyVal {
self.appliedTo(tparams map (_.typeRef)).LambdaAbstract(tparams)
}
+ def EtaExpandIfLambda(bound: Type)(implicit ctx: Context): Type =
+ if (bound.isLambda && self.typeSymbol.isClass && !isLambda) EtaExpand else self
+
/** Test whether this type has a base type of the form `B[T1, ..., Bn]` where
* the type parameters of `B` match one-by-one the variances of `tparams`,
* and where the lambda abstracted type