aboutsummaryrefslogblamecommitdiff
path: root/tests/pos/t5726.scala
blob: 1ef14ac790cb6229b1f314f0cc53f8600a099824 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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()
}