diff options
Diffstat (limited to 'test/files/pos/t5726.scala')
-rw-r--r-- | test/files/pos/t5726.scala | 17 |
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() +} |