Skip to content
Permalink
Browse files

Test cases for si-4536.

  • Loading branch information
axel22 committed May 2, 2012
1 parent c349168 commit bafe68e569f6d01d18a4d80da16443f66e372126
Showing with 54 additions and 0 deletions.
  1. +8 −0 test/files/run/t4536.check
  2. +46 −0 test/files/run/t4536.scala
@@ -0,0 +1,8 @@
cls: bar
obj: foo
obj: bar
cls: bar
obj: bar
trait: pili
trait: mili
trait: foo
@@ -0,0 +1,46 @@






object dynamicObject extends Dynamic {
def applyDynamic(m: String)() = println("obj: " + m);
this.foo()
}


class dynamicClass extends Dynamic {
def applyDynamic(m: String)() = println("cls: " + m);
this.bar()
dynamicObject.bar()
}


abstract class dynamicAbstractClass extends Dynamic {
def applyDynamic(m: String)(args: Any*): Unit
this.pili(1, new dynamicClass, "hello");
}


trait dynamicTrait extends Dynamic {
def applyDynamic(m: String)(args: Any*) = println("trait: " + m);
def two = 2
this.mili(1,2,3)
two
}


object dynamicMixin extends dynamicAbstractClass with dynamicTrait {
this.foo(None)
}


object Test {

def main(args: Array[String]) {
val cls = new dynamicClass
dynamicMixin
}

}

0 comments on commit bafe68e

Please sign in to comment.
You can’t perform that action at this time.