diff options
author | Paul Phillips <paulp@improving.org> | 2012-09-08 00:03:18 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-09-08 00:06:00 -0700 |
commit | 73cb55a80dc65577e593f59a16098cf915527a1d (patch) | |
tree | 0a4c3ed25c51f51cc4d5347c8f5629801470b3de /test/files/run/t6327.scala | |
parent | b7e08723d142c8227181eed283e7c982f449425a (diff) | |
download | scala-73cb55a80dc65577e593f59a16098cf915527a1d.tar.gz scala-73cb55a80dc65577e593f59a16098cf915527a1d.tar.bz2 scala-73cb55a80dc65577e593f59a16098cf915527a1d.zip |
Fix for SI-6327, wrongness in Dynamic.
Diffstat (limited to 'test/files/run/t6327.scala')
-rw-r--r-- | test/files/run/t6327.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/files/run/t6327.scala b/test/files/run/t6327.scala new file mode 100644 index 0000000000..7683101f14 --- /dev/null +++ b/test/files/run/t6327.scala @@ -0,0 +1,22 @@ +import language._ + +object Test extends App { + + case class R[+T](s: String) { def x() = println(s) } + + // Implicits in contention; StringR is nested to avoid ambiguity + object R { implicit val StringR = R[String]("A") } + implicit val Default = R[Any]("B") + + class B() extends Dynamic { + def selectDynamic[T](f: String)(implicit r: R[T]): Unit = r.x() + } + + val b = new B() + + // These should all produce the same output, but they don't + b.selectDynamic[String]("baz") + b.baz[String] + val c = b.selectDynamic[String]("baz") + val d = b.baz[String] +} |