diff options
author | odersky <odersky@gmail.com> | 2015-06-06 11:00:59 +0200 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2015-06-06 11:00:59 +0200 |
commit | 6ca52b0f23f0c3425d054d0918a149e0e7afb765 (patch) | |
tree | 2feaae75dc15cde118cc7fafc5912fa50247d3bd /tests/pos/scala2traits/dotty-subclass.scala | |
parent | c0770edba1f5ba85b5a48f2c2ce68704dbe00087 (diff) | |
parent | 0cdb29904affbf55d5f08a005e8b96acfd73aa81 (diff) | |
download | dotty-6ca52b0f23f0c3425d054d0918a149e0e7afb765.tar.gz dotty-6ca52b0f23f0c3425d054d0918a149e0e7afb765.tar.bz2 dotty-6ca52b0f23f0c3425d054d0918a149e0e7afb765.zip |
Merge pull request #622 from dotty-staging/add/implement-scala2-traits
Implement Scala2 traits
Diffstat (limited to 'tests/pos/scala2traits/dotty-subclass.scala')
-rw-r--r-- | tests/pos/scala2traits/dotty-subclass.scala | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/pos/scala2traits/dotty-subclass.scala b/tests/pos/scala2traits/dotty-subclass.scala new file mode 100644 index 000000000..4e162dd14 --- /dev/null +++ b/tests/pos/scala2traits/dotty-subclass.scala @@ -0,0 +1,27 @@ +// This is supposed to be compiled by Dotty +class Sub extends T + +class A extends S2T with S2Tprivate { + val a: Int = 3 + var b = 2 +} + +object Main { + def main(args: Array[String]): Unit = { + val sub = new Sub + println(sub.d) + println(sub.v) + println(sub.O) + println(sub.w) + + val a = new A + a.x += a.y + println(a.x) + println(a.f(a.a + a.b)) + + a.xx += a.yy + println(a.x) + println(a.ff(a.xx)) + } +} + |