From 651d67cff7af581751257711ad99d318a5a2879a Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Wed, 16 Mar 2016 16:40:58 -0700 Subject: Review feedback from Lukas --- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 ++++- test/files/pos/t9449.scala | 2 +- 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 : (() => )}) // typedEta(ii, pt = II) // adapt(ii, pt = (? => ?)) -- cgit v1.2.3