From 7e51434b89659c49a1cd755c224cc5ca270b82b3 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 19 Mar 2014 10:33:55 +0100 Subject: 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. --- tests/neg/t1292.scala | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/neg/t1292.scala (limited to 'tests/neg/t1292.scala') 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 +} -- cgit v1.2.3