diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-10-09 01:31:13 -0700 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-10-09 01:31:13 -0700 |
commit | 185ff4c929645a14fcfe77b6bcdea2bc28ece100 (patch) | |
tree | 9e3d37e8a950ac446b94d71d60b43d618a1fccb5 /src/compiler | |
parent | acd77803f7da7c369f4ffdc70b5eeec4a23e35ae (diff) | |
parent | 8ed7099f7db6a1060a490a594c958ca9a8b41487 (diff) | |
download | scala-185ff4c929645a14fcfe77b6bcdea2bc28ece100.tar.gz scala-185ff4c929645a14fcfe77b6bcdea2bc28ece100.tar.bz2 scala-185ff4c929645a14fcfe77b6bcdea2bc28ece100.zip |
Merge pull request #3022 from retronym/ticket/7899
Don't infer by-name types during, e.g. eta-expansion
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 03f680525c..ccf4a5e46f 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -913,12 +913,13 @@ trait Infer extends Checkable { val targs = exprTypeArgs(tvars, tparams, treeTp, pt, useWeaklyCompatible) def infer_s = map3(tparams, tvars, targs)((tparam, tvar, targ) => s"$tparam=$tvar/$targ") mkString "," printTyping(tree, s"infer expr instance from pt=$pt, $infer_s") + def targsStrict = if (targs eq null) null else targs mapConserve dropByName if (keepNothings || (targs eq null)) { //@M: adjustTypeArgs fails if targs==null, neg/t0226 - substExpr(tree, tparams, targs, pt) + substExpr(tree, tparams, targsStrict, pt) List() } else { - val AdjustedTypeArgs.Undets(okParams, okArgs, leftUndet) = adjustTypeArgs(tparams, tvars, targs) + val AdjustedTypeArgs.Undets(okParams, okArgs, leftUndet) = adjustTypeArgs(tparams, tvars, targsStrict) def solved_s = map2(okParams, okArgs)((p, a) => s"$p=$a") mkString "," def undet_s = leftUndet match { case Nil => "" |