diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-10 11:38:55 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-10 11:38:55 -0700 |
commit | ca23e50d2df14ce999c657a5f3cf79e5ffb6a450 (patch) | |
tree | 3ef98f240def1be8f4f170a25dba22ce61f84786 /src/compiler | |
parent | 782f362e0bcaa9609ed1a1c23c313257d0e22632 (diff) | |
parent | 73cb55a80dc65577e593f59a16098cf915527a1d (diff) | |
download | scala-ca23e50d2df14ce999c657a5f3cf79e5ffb6a450.tar.gz scala-ca23e50d2df14ce999c657a5f3cf79e5ffb6a450.tar.bz2 scala-ca23e50d2df14ce999c657a5f3cf79e5ffb6a450.zip |
Merge pull request #1270 from paulp/issue/6327
Fix for SI-6327, wrongness in Dynamic.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index d055c6ec48..a224c546e4 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3817,18 +3817,23 @@ trait Typers extends Modes with Adaptations with Tags { * - simplest solution: have two method calls * */ - def mkInvoke(cxTree: Tree, tree: Tree, qual: Tree, name: Name): Option[Tree] = + def mkInvoke(cxTree: Tree, tree: Tree, qual: Tree, name: Name): Option[Tree] = { + debuglog(s"mkInvoke($cxTree, $tree, $qual, $name)") acceptsApplyDynamicWithType(qual, name) map { tp => // tp eq NoType => can call xxxDynamic, but not passing any type args (unless specified explicitly by the user) // in scala-virtualized, when not NoType, tp is passed as type argument (for selection on a staged Struct) - // strip off type application -- we're not doing much with outer, so don't bother preserving cxTree's attributes etc - val (outer, explicitTargs) = cxTree match { - case TypeApply(fun, targs) => (fun, targs) - case Apply(TypeApply(fun, targs), args) => (Apply(fun, args), targs) - case t => (t, Nil) + // strip off type application -- we're not doing much with outer, + // so don't bother preserving cxTree's attributes etc + val cxTree1 = cxTree match { + case t: ValOrDefDef => t.rhs + case t => t + } + val (outer, explicitTargs) = cxTree1 match { + case TypeApply(fun, targs) => (fun, targs) + case Apply(TypeApply(fun, targs), args) => (Apply(fun, args), targs) + case t => (t, Nil) } - @inline def hasNamedArg(as: List[Tree]) = as.collectFirst{case AssignOrNamedArg(lhs, rhs) =>}.nonEmpty // note: context.tree includes at most one Apply node @@ -3853,6 +3858,7 @@ trait Typers extends Modes with Adaptations with Tags { atPos(qual.pos)(Apply(tappSel, List(Literal(Constant(name.decode))))) } + } } @inline final def deindentTyping() = context.typingIndentLevel -= 2 |