diff options
author | Martin Odersky <odersky@gmail.com> | 2016-07-25 12:51:35 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-25 12:51:35 +0200 |
commit | 66b04551306a20d1a8b1efd4914193e49209cf76 (patch) | |
tree | fbb3f80adcb2802d6e48875ae8c525641948ea40 /tests/run/i1263.scala | |
parent | 7b1fc312fbaeafbeb1eadc080be1aa2e905963e2 (diff) | |
download | dotty-66b04551306a20d1a8b1efd4914193e49209cf76.tar.gz dotty-66b04551306a20d1a8b1efd4914193e49209cf76.tar.bz2 dotty-66b04551306a20d1a8b1efd4914193e49209cf76.zip |
Extend test case to test variations of modifiers on trait parameters.
Diffstat (limited to 'tests/run/i1263.scala')
-rw-r--r-- | tests/run/i1263.scala | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/run/i1263.scala b/tests/run/i1263.scala index 4ae255711..630e5758e 100644 --- a/tests/run/i1263.scala +++ b/tests/run/i1263.scala @@ -8,3 +8,27 @@ object Test { assert(foo2.s == "bar") } } +object Test1 { + trait Foo(private val s0: String) { + def s = s0 + } + + val foo1 = new Foo("bar") {} + def main(args: Array[String]): Unit = { + assert(foo1.s == "bar") + } +} +object Test2 { + trait Foo(protected val s: String) + + val foo1 = new Foo("bar") {} + val foo2 = new Foo { override val s = "bar" } +} +object Test3 { + trait Foo(final val s: String) + + val foo1 = new Foo("bar") {} + def main(args: Array[String]): Unit = { + assert(foo1.s == "bar") + } +} |