aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/t1292.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-19 10:33:55 +0100
committerTobias Schlatter <tobias@meisch.ch>2014-03-21 11:28:30 +0100
commit7e51434b89659c49a1cd755c224cc5ca270b82b3 (patch)
tree5cc0aa0c4d7005c720fda5238cffc2bcd760e3d6 /tests/neg/t1292.scala
parentc854cc7fcc9d0f889c6235c1534133cff7360e7f (diff)
downloaddotty-7e51434b89659c49a1cd755c224cc5ca270b82b3.tar.gz
dotty-7e51434b89659c49a1cd755c224cc5ca270b82b3.tar.bz2
dotty-7e51434b89659c49a1cd755c224cc5ca270b82b3.zip
Fix for t1292 - legal prefixes
The original test is now in error because the type Meta in the prefix Meta#Event is not stable and contains an abstract member Slog. Even after removing Slog, the test in pos was still in error because the bound type parameters were incorrectly recognized as abstract members. This has been fixed by the changes to Types.
Diffstat (limited to 'tests/neg/t1292.scala')
-rw-r--r--tests/neg/t1292.scala35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/neg/t1292.scala b/tests/neg/t1292.scala
new file mode 100644
index 000000000..69e680320
--- /dev/null
+++ b/tests/neg/t1292.scala
@@ -0,0 +1,35 @@
+trait Foo[T <: Foo[T, Enum], Enum <: Enumeration] {
+ type StV = Enum#Value
+ type Meta = MegaFoo[T, Enum]
+
+ type Slog <: Enumeration
+
+ def getSingleton: Meta
+}
+
+trait MegaFoo[T <: Foo[T, Enum], Enum <: Enumeration] extends Foo[T, Enum] {
+ def doSomething(what: T, misc: StV, dog: Meta#Event) = None
+ // error: Meta is not a valid prefix for '#'.
+ // The error is correct. Meta is not stable, and it has an abstract type member Slog
+ abstract class Event
+ object Event
+
+ def stateEnumeration: Slog
+ def se2: Enum
+}
+
+object E extends Enumeration {
+ val A = Value
+ val B = Value
+}
+
+class RFoo extends Foo[RFoo, E.type] {
+ def getSingleton = MegaRFoo
+
+ type Slog = E.type
+}
+
+object MegaRFoo extends RFoo with MegaFoo[RFoo, E.type] {
+ def stateEnumeration = E
+ def se2 = E
+}