summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorJan Niehusmann <jan@gondor.com>2012-11-13 22:14:34 +0100
committerJan Niehusmann <jan@gondor.com>2012-11-16 23:54:11 +0100
commitc6569209dab006e74ccecc0ede6ce7815ac8629c (patch)
tree32105de312055560c5e2b2fd8b0a089459d460d5 /src/compiler
parent850108886765e99e894f7613f49c1bab3650a0c2 (diff)
downloadscala-c6569209dab006e74ccecc0ede6ce7815ac8629c.tar.gz
scala-c6569209dab006e74ccecc0ede6ce7815ac8629c.tar.bz2
scala-c6569209dab006e74ccecc0ede6ce7815ac8629c.zip
SI-6663: don't ignore type parameter on selectDynamic invocation
Fix mkInvoke to handle selectDynamic calls of the form new C.foo[T].xyz or new C.foo[T].xyz :U (where C extends Dynamic) Without this patch, the type parameter was silently ignored, and possibly inferred to a different. This patch fixes mkInvoke to handle these cases, where ctxTree has the form Select(TypeApply(fun, targs), nme) or Typed(...)
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index d3847de894..80785cee2f 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -3935,9 +3935,14 @@ trait Typers extends Modes with Adaptations with Tags {
case t: ValOrDefDef => t.rhs
case t => t
}
- val (outer, explicitTargs) = cxTree1 match {
+ val cxTree2 = cxTree1 match {
+ case Typed(t, tpe) => t // ignore outer type annotation
+ case t => t
+ }
+ val (outer, explicitTargs) = cxTree2 match {
case TypeApply(fun, targs) => (fun, targs)
case Apply(TypeApply(fun, targs), args) => (Apply(fun, args), targs)
+ case Select(TypeApply(fun, targs), nme) => (Select(fun, nme), targs)
case t => (t, Nil)
}
def hasNamedArg(as: List[Tree]) = as.collectFirst{case AssignOrNamedArg(lhs, rhs) =>}.nonEmpty