Added a test for a trait extending two traits.

This commit is contained in:
Pavel Talanov
2011-11-16 19:40:28 +04:00
parent 81d7f86b93
commit 9d848cb8a5
2 changed files with 30 additions and 0 deletions
@@ -39,4 +39,9 @@ public final class TraitTest extends AbstractClassTest {
testFooBoxIsTrue("traitExtendsTrait.kt");
}
@Test
public void traitExtendsTwoTraits() throws Exception {
testFooBoxIsTrue("traitExtendsTwoTraits.kt");
}
}
@@ -0,0 +1,25 @@
namespace foo
trait A {
fun addFoo(s:String) : String {
return s + "FOO"
}
}
trait B {
fun hooray() : String {
return "hooray"
}
}
trait AD : A, B {
}
class Test() : AD {
fun eval() : String {
return addFoo(hooray());
}
}
fun box() = (Test().eval() == "hoorayFOO")