aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/i1050.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-01-31 23:55:27 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-09 09:43:06 +0100
commita0fb0685fcfc5e988e0d033af26c1055269488e5 (patch)
tree71916852f90187a91a99fdbe4ca3ca17a94f860c /tests/neg/i1050.scala
parente87dee212351aa7acb15760814cdd1c30c4de019 (diff)
downloaddotty-a0fb0685fcfc5e988e0d033af26c1055269488e5.tar.gz
dotty-a0fb0685fcfc5e988e0d033af26c1055269488e5.tar.bz2
dotty-a0fb0685fcfc5e988e0d033af26c1055269488e5.zip
Handle imports in path checks.
If `T` is a member of `p` then { import p._; ... T ... } should be checked in the same way as { ... p.T ... }
Diffstat (limited to 'tests/neg/i1050.scala')
-rw-r--r--tests/neg/i1050.scala20
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/neg/i1050.scala b/tests/neg/i1050.scala
index 047d9f776..25e647a57 100644
--- a/tests/neg/i1050.scala
+++ b/tests/neg/i1050.scala
@@ -40,7 +40,7 @@ object Tiark1 {
trait B { type L >: Any}
trait U {
lazy val p: B
- def brand(x: Any): p.L = x // error: not final
+ def brand(x: Any): p.L = x // error: nonfinal lazy
}
trait V extends U {
lazy val p: A & B = ???
@@ -54,7 +54,7 @@ object Tiark2 {
trait U {
type X <: B
lazy val p: X
- def brand(x: Any): p.L = x // error: not final
+ def brand(x: Any): p.L = x // error: nonfinal lazy
}
trait V extends U {
type X = B & A
@@ -70,7 +70,7 @@ object Tiark3 {
type X <: B
def p2: X
final lazy val p: X = p2
- def brand(x: Any): p.L = x
+ def brand(x: Any): p.L = x // error: underlying not concrete
}
trait V extends U {
type X = B with A
@@ -79,20 +79,18 @@ object Tiark3 {
val v = new V {}
v.brand("boom!"): Nothing
}
-/*
object Import {
trait A { type L <: Nothing }
trait B { type L >: Any}
trait U {
- val p: B
- def brand(x: Any): p.L = x // error: not final
- locally { import p._
+ lazy val p: B
+ locally { val x: p.L = ??? } // error: nonfinal lazy
+ locally {
+ import p._
+ val x: L = ??? // error: nonfinal lazy
}
}
trait V extends U {
lazy val p: A & B = ???
- }
- val v = new V {}
- v.brand("boom!")
}
-*/
+