aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDmitry Petrashko <dark@d-d.me>2015-06-12 13:25:38 +0200
committerDmitry Petrashko <dark@d-d.me>2015-06-12 13:25:38 +0200
commitae8a24638551913a60097a5a07c74f5e98e43af0 (patch)
treeb0dbbd4da34eb1e8488b22e494ffee7e00b314fd /tests
parent1962ada58fcd2333a2e40179ab0ac6efb6167ed2 (diff)
parent0584e0ff783419b927145509f8c1dfea5e0510f4 (diff)
downloaddotty-ae8a24638551913a60097a5a07c74f5e98e43af0.tar.gz
dotty-ae8a24638551913a60097a5a07c74f5e98e43af0.tar.bz2
dotty-ae8a24638551913a60097a5a07c74f5e98e43af0.zip
Merge pull request #635 from dotty-staging/fix/private-scala2-trait-setters
Some fixes around mixin and memoization
Diffstat (limited to 'tests')
-rw-r--r--tests/pos/scala2traits/dotty-subclass.scala8
-rw-r--r--tests/pos/scala2traits/scala-trait.scala6
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/pos/scala2traits/dotty-subclass.scala b/tests/pos/scala2traits/dotty-subclass.scala
index 4e162dd14..62720b993 100644
--- a/tests/pos/scala2traits/dotty-subclass.scala
+++ b/tests/pos/scala2traits/dotty-subclass.scala
@@ -1,7 +1,13 @@
// This is supposed to be compiled by Dotty
class Sub extends T
-class A extends S2T with S2Tprivate {
+trait DT {
+
+ @volatile lazy val dx = 2
+
+}
+
+class A extends S2T with S2Tprivate with DT {
val a: Int = 3
var b = 2
}
diff --git a/tests/pos/scala2traits/scala-trait.scala b/tests/pos/scala2traits/scala-trait.scala
index db05bc941..4d91b12b2 100644
--- a/tests/pos/scala2traits/scala-trait.scala
+++ b/tests/pos/scala2traits/scala-trait.scala
@@ -9,7 +9,7 @@ trait T {
trait S2T {
var x: Int = 0
lazy val y: Int = 1
-// val z: Int = 2
+ val z: Int = 2
val a: Int
var b: Int
@@ -19,13 +19,13 @@ trait S2T {
trait S2Tprivate {
private var x: Int = 0
private lazy val y: Int = 1
-// private val z: Int = 2 // @darkdimius uncomment once lazy vals can be inherited.
+ private val z: Int = 2
private def f(x: Int): Int = x + y
def xx = x
def xx_=(x: Int) = this.x = x
def yy = y
-// def zz = z
+ def zz = z
def ff(x: Int) = f(x)
}