summaryrefslogblamecommitdiff
path: root/test/files/pos/t5726.scala
blob: b28ebd86741ac0a63da79f70b1c2877688fe99e7 (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) {
    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()
}