diff options
Diffstat (limited to 'tests/pos/t5726.scala')
-rw-r--r-- | tests/pos/t5726.scala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/pos/t5726.scala b/tests/pos/t5726.scala new file mode 100644 index 000000000..1ef14ac79 --- /dev/null +++ b/tests/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): Unit = { + println(s"You have just updated property '$name' with value: $value") + } +} + +object MyApp extends App { + def testing(): Unit = { + val test = new DynamicTest + test.firstName = "John" + } + + testing() +} |