summaryrefslogtreecommitdiff
path: root/test/files/pos/t5726.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-11-28 18:36:47 +0100
committerPaul Phillips <paulp@improving.org>2012-11-29 09:39:21 +0100
commita6941944bf80f660722e9151801776715c3e4ab5 (patch)
treeef0bec6d22cc02af500cc1b88bfd5fd8ded86d22 /test/files/pos/t5726.scala
parentdac1488a889ff5952ff85e87ec4acd7d72a74891 (diff)
downloadscala-a6941944bf80f660722e9151801776715c3e4ab5.tar.gz
scala-a6941944bf80f660722e9151801776715c3e4ab5.tar.bz2
scala-a6941944bf80f660722e9151801776715c3e4ab5.zip
Test cases for SI-5726, SI-5733, SI-6320, SI-6551, SI-6722.
All tickets involving selectDynamic fixed by the prior commit. It also fixes SI-6663, but that already has a test case.
Diffstat (limited to 'test/files/pos/t5726.scala')
-rw-r--r--test/files/pos/t5726.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/pos/t5726.scala b/test/files/pos/t5726.scala
new file mode 100644
index 0000000000..b28ebd8674
--- /dev/null
+++ b/test/files/pos/t5726.scala
@@ -0,0 +1,17 @@
+import scala.language.dynamics
+
+class DynamicTest extends Dynamic {
+ def selectDynamic(name: String) = s"value of $name"
+ def updateDynamic(name: String)(value: Any) {
+ println(s"You have just updated property '$name' with value: $value")
+ }
+}
+
+object MyApp extends App {
+ def testing() {
+ val test = new DynamicTest
+ test.firstName = "John"
+ }
+
+ testing()
+}