summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-12-01 16:32:05 +0000
committerMartin Odersky <odersky@gmail.com>2006-12-01 16:32:05 +0000
commit4f6a14b33d664dede92b8d7063d7cd437023d987 (patch)
tree56aca630fd98a8be62798e52b6f03900d4166275 /test
parent8a9719c222b39a35b70fef7b5eb56c842fa2cea0 (diff)
downloadscala-4f6a14b33d664dede92b8d7063d7cd437023d987.tar.gz
scala-4f6a14b33d664dede92b8d7063d7cd437023d987.tar.bz2
scala-4f6a14b33d664dede92b8d7063d7cd437023d987.zip
updated tests.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/abstract.check10
-rw-r--r--test/files/neg/bug415.check12
-rw-r--r--test/files/neg/bug415.scala16
-rw-r--r--test/files/neg/bug839.check5
-rw-r--r--test/files/neg/bug839.scala26
-rw-r--r--test/files/pos/bug415.scala9
6 files changed, 46 insertions, 32 deletions
diff --git a/test/files/neg/abstract.check b/test/files/neg/abstract.check
index 86fded0fce..a64a5da85f 100644
--- a/test/files/neg/abstract.check
+++ b/test/files/neg/abstract.check
@@ -1,11 +1,19 @@
+abstract.scala:5 error: method bar cannot be accessed in A.this.T
+ because its instance type ()A.this.T#T contains a malformed type: A.this.T#T
+ def foo1: A = bar().bar();
+ ^
abstract.scala:6 error: type mismatch;
found : A
required: A.this.T
def foo2: T = bar().baz();
^
+abstract.scala:8 error: method bar cannot be accessed in A
+ because its instance type ()A#T contains a malformed type: A#T
+ def foo4: A = baz().bar();
+ ^
abstract.scala:9 error: type mismatch;
found : A
required: A.this.T
def foo5: T = baz().baz();
^
-two errors found
+four errors found
diff --git a/test/files/neg/bug415.check b/test/files/neg/bug415.check
index 76dbc64bc2..c6c9805aa6 100644
--- a/test/files/neg/bug415.check
+++ b/test/files/neg/bug415.check
@@ -1,9 +1,5 @@
-bug415.scala:10 error: method x cannot be accessed in A
+bug415.scala:8 error: method x cannot be accessed in A
because its instance type => A#T contains a malformed type: A#T
- val y = a.x;
- ^
-bug415.scala:20 error: method x cannot be accessed in A2
- because its instance type => scala.Array[A2#T] contains a malformed type: A2#T
- val y: Array[String] = a.x;
- ^
-two errors found
+ val y: String = a.x;
+ ^
+one error found
diff --git a/test/files/neg/bug415.scala b/test/files/neg/bug415.scala
index ea7f89f39a..355b6136d1 100644
--- a/test/files/neg/bug415.scala
+++ b/test/files/neg/bug415.scala
@@ -1,21 +1,9 @@
-class Foo[T]
-
abstract class A {
- type T <: Foo[T]
+ type T <: String;
def x: T;
}
abstract class B {
def a: A;
- val y = a.x;
-}
-
-abstract class A2 {
- type T <: String
- def x: Array[T]
-}
-
-abstract class B2 {
- def a: A2;
- val y: Array[String] = a.x;
+ val y: String = a.x;
}
diff --git a/test/files/neg/bug839.check b/test/files/neg/bug839.check
new file mode 100644
index 0000000000..2308ac826b
--- /dev/null
+++ b/test/files/neg/bug839.check
@@ -0,0 +1,5 @@
+bug839.scala:25 error: method set cannot be accessed in object Test.this.FileImpl#treeBuilder
+ because its instance type (Test.this.FileImpl#treeBuilder#global.Tree)scala.Unit contains a malformed type: object Test.this.FileImpl#treeBuilder#global
+ file.treeBuilder.set(nsc.get);
+ ^
+one error found
diff --git a/test/files/neg/bug839.scala b/test/files/neg/bug839.scala
new file mode 100644
index 0000000000..d845ed3aae
--- /dev/null
+++ b/test/files/neg/bug839.scala
@@ -0,0 +1,26 @@
+// see pending/pos/bug112606A.scala
+package test;
+trait Test {
+ trait Global {
+ type Tree;
+ def get : Tree;
+ }
+ trait TreeBuilder {
+ val global : Global;
+ def set(tree : global.Tree) = {}
+ }
+ val nsc : Global;
+ trait FileImpl {
+ object treeBuilder extends TreeBuilder {
+ val global : nsc.type = nsc;
+ }
+ // OK
+ treeBuilder.set(nsc.get);
+ }
+ val file0 : FileImpl;
+ // OK
+ file0.treeBuilder.set(nsc.get);
+ def file : FileImpl;
+ // type mismatch
+ file.treeBuilder.set(nsc.get);
+}
diff --git a/test/files/pos/bug415.scala b/test/files/pos/bug415.scala
deleted file mode 100644
index 355b6136d1..0000000000
--- a/test/files/pos/bug415.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-abstract class A {
- type T <: String;
- def x: T;
-}
-
-abstract class B {
- def a: A;
- val y: String = a.x;
-}