summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2016-03-16 16:40:58 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2016-03-26 22:49:29 -0700
commit651d67cff7af581751257711ad99d318a5a2879a (patch)
tree059beae5bc6b16e720c26b11ce10847d59d80b09
parent1acfc70b038b09018d3ba1cc4b8c968e2a93d33c (diff)
downloadscala-651d67cff7af581751257711ad99d318a5a2879a.tar.gz
scala-651d67cff7af581751257711ad99d318a5a2879a.tar.bz2
scala-651d67cff7af581751257711ad99d318a5a2879a.zip
Review feedback from Lukas
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala5
-rw-r--r--test/files/pos/t9449.scala2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index d9d68f0773..55d49929a8 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -3219,7 +3219,10 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
// less expensive than including them in inferMethodAlternative (see below).
def shapeType(arg: Tree): Type = arg match {
case Function(vparams, body) =>
- functionType(vparams map (_ => AnyTpe), shapeType(body)) // TODO: should this be erased when retyping during erasure?
+ // No need for phasedAppliedType, as we don't get here during erasure --
+ // overloading resolution happens during type checking.
+ // During erasure, the condition above (fun.symbol.isOverloaded) is false.
+ functionType(vparams map (_ => AnyTpe), shapeType(body))
case AssignOrNamedArg(Ident(name), rhs) =>
NamedType(name, shapeType(rhs))
case _ =>
diff --git a/test/files/pos/t9449.scala b/test/files/pos/t9449.scala
index 06653cca83..3b86dc80a0 100644
--- a/test/files/pos/t9449.scala
+++ b/test/files/pos/t9449.scala
@@ -7,7 +7,7 @@ object Test {
def test = {
val ii1: II = x => ii(x) // works
val ii2: II = ii // works (adapting `ii` to `II`)
- val ii3: II = ii _ // fails -- should work
+ val ii3: II = ii _ // works (failed before the fix)
// typedTyped({ii : (() => <empty>)})
// typedEta(ii, pt = II)
// adapt(ii, pt = (? => ?))