summaryrefslogtreecommitdiff
path: root/test/files/run/dynamic-applyDynamic.scala
blob: b06041194c1ec8be78a0f3263b264966c92e81d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import scala.tools.partest.DirectTest

object Test extends DirectTest {

  override def extraSettings: String =
    s"-usejavacp -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}"

  override def code = """
    object X {
      val d = new D
      d.method(10)
      d(10)
    }
  """.trim

  override def show(): Unit = {
    Console.withErr(System.out) {
      compile()
    }
  }
}

import language.dynamics
class D extends Dynamic {
  def applyDynamic(name: String)(value: Any) = ???
}