Permalink
Browse files

Merge pull request #1608 from retronym/ticket/6644

SI-6644 Account for varargs in extmethod forwarder
  • Loading branch information...
2 parents a1710cd + 1e0a30a commit 49de2226c282285d099ac5903fe10b07e3087b5d @jsuereth jsuereth committed Nov 14, 2012
Showing with 9 additions and 3 deletions.
  1. +1 −3 src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
  2. +8 −0 test/files/run/t6644.scala
@@ -173,9 +173,7 @@ abstract class ExtensionMethods extends Transform with TypingTransformers {
List(This(currentOwner)))
val extensionCall = atOwner(origMeth) {
localTyper.typedPos(rhs.pos) {
- (extensionCallPrefix /: vparamss) {
- case (fn, params) => Apply(fn, params map (param => Ident(param.symbol)))
- }
+ gen.mkForwarder(extensionCallPrefix, mmap(vparamss)(_.symbol))
}
}
deriveDefDef(tree)(_ => extensionCall)
@@ -0,0 +1,8 @@
+class Testable(val c: String) extends AnyVal {
+ def matching(cases: Boolean*) = cases contains true
+}
+
+object Test extends App {
+ assert(new Testable("").matching(true, false))
+}
+

0 comments on commit 49de222

Please sign in to comment.