diff options
author | Martin Odersky <odersky@gmail.com> | 2016-07-11 18:05:36 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-12 18:14:04 +0200 |
commit | cdebd91712b36b048233d7cf9501cc7a5bb50b31 (patch) | |
tree | 35d3ee5d8800e958640916cd0145def1f5726751 /tests/neg | |
parent | 1792c9e9bcff1feba7b50a24a46e1e20d8a39d9b (diff) | |
download | dotty-cdebd91712b36b048233d7cf9501cc7a5bb50b31.tar.gz dotty-cdebd91712b36b048233d7cf9501cc7a5bb50b31.tar.bz2 dotty-cdebd91712b36b048233d7cf9501cc7a5bb50b31.zip |
Allow definition of new types in refinements
Allow definition of types in refinements that do not appear
in parent type.
Diffstat (limited to 'tests/neg')
-rw-r--r-- | tests/neg/i39.scala | 2 | ||||
-rw-r--r-- | tests/neg/i50-volatile.scala | 4 | ||||
-rw-r--r-- | tests/neg/subtyping.scala | 2 | ||||
-rw-r--r-- | tests/neg/zoo.scala | 12 |
4 files changed, 10 insertions, 10 deletions
diff --git a/tests/neg/i39.scala b/tests/neg/i39.scala index df53d9816..8a13a7d06 100644 --- a/tests/neg/i39.scala +++ b/tests/neg/i39.scala @@ -1,7 +1,7 @@ object i39neg { trait B { - type D <: { type T } // error + type D <: { type T } def d: D } diff --git a/tests/neg/i50-volatile.scala b/tests/neg/i50-volatile.scala index f6fa3466d..fcfc9592b 100644 --- a/tests/neg/i50-volatile.scala +++ b/tests/neg/i50-volatile.scala @@ -3,10 +3,10 @@ class Test { class Inner } type A <: Base { - type X = String // error + type X = String // old-error } type B <: { - type X = Int // error + type X = Int // old-error } lazy val o: A & B = ??? diff --git a/tests/neg/subtyping.scala b/tests/neg/subtyping.scala index 27cc0568e..351fa0ecd 100644 --- a/tests/neg/subtyping.scala +++ b/tests/neg/subtyping.scala @@ -8,7 +8,7 @@ object Test { implicitly[B#X <:< A#X] // error: no implicit argument } def test2(): Unit = { - val a : { type T; type U } = ??? // error // error + val a : { type T; type U } = ??? implicitly[a.T <:< a.U] // error: no implicit argument } } diff --git a/tests/neg/zoo.scala b/tests/neg/zoo.scala index 3d9b77b72..19efcc1d7 100644 --- a/tests/neg/zoo.scala +++ b/tests/neg/zoo.scala @@ -1,23 +1,23 @@ object Test { type Meat = { - type IsMeat = Any // error + type IsMeat = Any } type Grass = { - type IsGrass = Any // error + type IsGrass = Any } type Animal = { - type Food // error + type Food def eats(food: Food): Unit // error def gets: Food // error } type Cow = { - type IsMeat = Any // error - type Food <: Grass // error + type IsMeat = Any + type Food <: Grass def eats(food: Grass): Unit // error def gets: Grass // error } type Lion = { - type Food = Meat // error + type Food = Meat def eats(food: Meat): Unit // error def gets: Meat // error } |