summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-08-22 16:20:09 +0000
committerMartin Odersky <odersky@gmail.com>2006-08-22 16:20:09 +0000
commit9050da710809b5d9fafa577264b0e1aa61fc6ef7 (patch)
tree49f92667370f2dc78e03612ca1c925b583ff1144 /test/files/neg
parentdd535c3645330025d366f82f1032184b51886274 (diff)
downloadscala-9050da710809b5d9fafa577264b0e1aa61fc6ef7.tar.gz
scala-9050da710809b5d9fafa577264b0e1aa61fc6ef7.tar.bz2
scala-9050da710809b5d9fafa577264b0e1aa61fc6ef7.zip
Fixed bugs. Generalized implicit lookup.
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/bug691.check4
-rwxr-xr-xtest/files/neg/bug691.scala29
-rw-r--r--test/files/neg/bug712.check4
-rw-r--r--test/files/neg/bug712.scala19
4 files changed, 56 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;
+}