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 /test/files | |
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 'test/files')
-rw-r--r-- | test/files/run/t6327.check | 4 | ||||
-rw-r--r-- | test/files/run/t6327.scala | 22 |
2 files changed, 26 insertions, 0 deletions
diff --git a/test/files/run/t6327.check b/test/files/run/t6327.check new file mode 100644 index 0000000000..f7bacac931 --- /dev/null +++ b/test/files/run/t6327.check @@ -0,0 +1,4 @@ +A +A +A +A 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] +} |