diff options
author | Martin Odersky <odersky@gmail.com> | 2015-02-11 18:47:56 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-02-11 18:47:56 +0100 |
commit | 000461c376807d51964841ae9cb08d5f255ea2a2 (patch) | |
tree | c845e847ded866316ad2aeade5531417a7c9d74d /src/dotty/tools/dotc/core/TypeApplications.scala | |
parent | 03a2c6e74c07d08e79ee3323d3c1c38eb3d588ef (diff) | |
download | dotty-000461c376807d51964841ae9cb08d5f255ea2a2.tar.gz dotty-000461c376807d51964841ae9cb08d5f255ea2a2.tar.bz2 dotty-000461c376807d51964841ae9cb08d5f255ea2a2.zip |
Fix to testLifted
If the original type does not have the right type parameters, look in the baseclasses.
Previously this was done only if the original type did not have any type parameters.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeApplications.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala index 4a16ca45d..6f75142c4 100644 --- a/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/src/dotty/tools/dotc/core/TypeApplications.scala @@ -509,7 +509,7 @@ class TypeApplications(val self: Type) extends AnyVal { * { type $hkArg$0 = T1; ...; type $hkArg$n = Tn } * * satisfies predicate `p`. Try base types in the order of their occurrence in `baseClasses`. - * A type parameter matches a varianve V if it has V as its variance or if V == 0. + * A type parameter matches a variance V if it has V as its variance or if V == 0. */ def testLifted(tparams: List[Symbol], p: Type => Boolean)(implicit ctx: Context): Boolean = { def tryLift(bcs: List[ClassSymbol]): Boolean = bcs match { @@ -534,7 +534,7 @@ class TypeApplications(val self: Type) extends AnyVal { false } if (tparams.isEmpty) false - else if (typeParams.nonEmpty) p(EtaExpand) + else if (typeParams.nonEmpty) p(EtaExpand) || tryLift(self.baseClasses) else tryLift(self.baseClasses) } }
\ No newline at end of file |