diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/bug691.check | 4 | ||||
-rwxr-xr-x | test/files/neg/bug691.scala | 29 | ||||
-rw-r--r-- | test/files/neg/bug712.check | 4 | ||||
-rw-r--r-- | test/files/neg/bug712.scala | 19 | ||||
-rw-r--r-- | test/files/pos/bug661.scala | 17 | ||||
-rwxr-xr-x | test/files/pos/bug690.scala | 14 | ||||
-rwxr-xr-x | test/files/pos/bug694.scala | 10 |
7 files changed, 97 insertions, 0 deletions
diff --git a/test/files/neg/bug691.check b/test/files/neg/bug691.check new file mode 100644 index 0000000000..252ce6b5d3 --- /dev/null +++ b/test/files/neg/bug691.check @@ -0,0 +1,4 @@ +bug691.scala:27 error: ambiguous parent class qualifier + trait TiC extends super[Arrow].Ti2 with super[AssignArrow].Ti1;
+ ^ +one error found diff --git a/test/files/neg/bug691.scala b/test/files/neg/bug691.scala new file mode 100755 index 0000000000..233476f658 --- /dev/null +++ b/test/files/neg/bug691.scala @@ -0,0 +1,29 @@ +trait Base { + trait AssignArrow { + type T <: Ti0; + trait Ti0; + } + abstract class Arrow extends AssignArrow; + val arrow : Arrow; +} + +trait Ext0 extends Base { + trait AssignArrow extends super.AssignArrow { + type T <: Ti1; + trait Ti1 extends super.Ti0; + } +} +trait Ext1 extends Base { + trait Arrow extends super.Arrow { + type T <: Ti2; + trait Ti2 extends super.Ti0; + trait TiXX extends Ti2; + } + val arrow : Arrow; +} +trait Composition extends Ext0 with Ext1 { + object arrow0 extends Arrow with AssignArrow { + type T = TiC + trait TiC extends super[Arrow].Ti2 with super[AssignArrow].Ti1; + } +} diff --git a/test/files/neg/bug712.check b/test/files/neg/bug712.check new file mode 100644 index 0000000000..277aaf6be5 --- /dev/null +++ b/test/files/neg/bug712.check @@ -0,0 +1,4 @@ +bug712.scala:10 error: value self is not a member of B.this.ParentImpl + implicit def coerce(p : ParentImpl) = p.self; + ^ +one error found diff --git a/test/files/neg/bug712.scala b/test/files/neg/bug712.scala new file mode 100644 index 0000000000..0887810c85 --- /dev/null +++ b/test/files/neg/bug712.scala @@ -0,0 +1,19 @@ +trait A { + type Node <: NodeImpl; + implicit def coerce(n : NodeImpl) = n.self; + trait NodeImpl { + def self : Node; + } +} +trait B extends A { + type Parent <: ParentImpl; + implicit def coerce(p : ParentImpl) = p.self; + trait ParentImpl; + type Symbol; + trait SymbolImpl { + def scope : Int; + } + implicit def coerceSym(sym : Symbol) : SymbolImpl; + var s : Symbol = null; + val s_scope = s.scope; +} diff --git a/test/files/pos/bug661.scala b/test/files/pos/bug661.scala new file mode 100644 index 0000000000..3a447241fe --- /dev/null +++ b/test/files/pos/bug661.scala @@ -0,0 +1,17 @@ +package test; + +object test { + abstract class A { + abstract class C { + type M; + def foo(n : M) : Unit = {} + } + } + trait B extends A { + type N; + trait C extends super.C { + type M = N; + override def foo(n : M) : Unit = super.foo(n); + } + } +} diff --git a/test/files/pos/bug690.scala b/test/files/pos/bug690.scala new file mode 100755 index 0000000000..a93c54f007 --- /dev/null +++ b/test/files/pos/bug690.scala @@ -0,0 +1,14 @@ +package test; +trait test { + type T; + trait Manager { + type T <: test.this.T; + def foo(t : T) = {}; + } + object M0 extends Manager { + override type T = test.this.T; + override def foo(t : T) = super.foo(t); + } + def t : T; + M0.foo(t); +} diff --git a/test/files/pos/bug694.scala b/test/files/pos/bug694.scala new file mode 100755 index 0000000000..96eb55f5c0 --- /dev/null +++ b/test/files/pos/bug694.scala @@ -0,0 +1,10 @@ +object test3 { + trait Type[T]; + case object IntType extends Type[Int]; + case object StringType extends Type[String]; + + def f[T](t : Type[T]) : T = t match { + case IntType => 10; + case StringType => "hello"; + } +}
\ No newline at end of file |