diff options
author | Martin Odersky <odersky@gmail.com> | 2015-07-14 17:37:52 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-09-18 18:05:15 +0200 |
commit | fdf8f867fa1a1d2493052b19bd50907f1b5d75e8 (patch) | |
tree | b4b6126e16a705000fc569a505b9c579314a7f5b /src/dotty/tools/dotc/typer/Namer.scala | |
parent | 0d95c76466012f9a7e6535ebba0620df4042f179 (diff) | |
download | dotty-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/typer/Namer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 8b204debb..eef0ce8b0 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -811,9 +811,6 @@ class Namer { typer: Typer => * type parameter to type lambdas, e.g. [HK0] => C[HK0] */ def etaExpandArgs(implicit ctx: Context) = new TypeMap { - def etaExpandArg(tp: Type, tparam: Symbol): Type = - if (tparam.info.isLambda && tp.typeSymbol.isClass && tp.isLambda) tp.EtaExpand - else tp def apply(tp: Type): Type = { tp match { case tp: RefinedType => @@ -822,7 +819,7 @@ class Namer { typer: Typer => val tycon = tp.withoutArgs(args) val tparams = tycon.typeParams if (args.length == tparams.length) { // if lengths differ, problem is caught in typedTypeApply - val args1 = args.zipWithConserve(tparams)(etaExpandArg) + val args1 = args.zipWithConserve(tparams)((arg, tparam) => arg.EtaExpandIfLambda(tparam.info)) if (args1 ne args) return this(tycon).appliedTo(args1) } } |