Created
February 23, 2014 09:35
-
-
Save kxbmap/9169185 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ scalac sample.scala | |
sample.scala:14: error: applyDynamic does not support passing a vararg parameter | |
new Foo().foo(xs:_*).foobar(new Bar().bar) | |
^ | |
one error found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.language.dynamics | |
class Foo { | |
def foo(xs: Int*): Foo = ??? | |
def foobar(b: Bar): Int = ??? | |
} | |
class Bar extends Dynamic { | |
def selectDynamic(name: String): Bar = ??? | |
} | |
object Sample extends App { | |
val xs = Seq(1, 2, 3) | |
new Foo().foo(xs:_*).foobar(new Bar().bar) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment