summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/bug900.check10
-rw-r--r--test/files/neg/bug900.scala5
-rw-r--r--test/files/neg/implicits.check5
-rw-r--r--test/files/neg/nopredefs.check4
-rw-r--r--test/files/neg/nopredefs.scala6
-rw-r--r--test/files/neg/viewtest.check2
-rw-r--r--test/files/pos/bug911.scala6
7 files changed, 36 insertions, 2 deletions
diff --git a/test/files/neg/bug900.check b/test/files/neg/bug900.check
new file mode 100644
index 0000000000..531ac5bee4
--- /dev/null
+++ b/test/files/neg/bug900.check
@@ -0,0 +1,10 @@
+bug900.scala:4: error: type mismatch;
+ found : Foo.this.x.type (with underlying type Foo.this.bar)
+ required: java.lang.Object
+Note that implicit conversions are not applicable because they are ambiguous:
+ both method any2stringadd in object Predef of type (scala.Any)scala.runtime.StringAdd
+ and method any2ArrowAssoc in object Predef of type [a](a)scala.Predef.ArrowAssoc[a]
+ are possible conversion functions from Foo.this.x.type to java.lang.Object
+ def break(): x.type
+ ^
+one error found
diff --git a/test/files/neg/bug900.scala b/test/files/neg/bug900.scala
new file mode 100644
index 0000000000..2d2c857575
--- /dev/null
+++ b/test/files/neg/bug900.scala
@@ -0,0 +1,5 @@
+trait Foo {
+ type bar
+ val x : bar
+ def break(): x.type
+}
diff --git a/test/files/neg/implicits.check b/test/files/neg/implicits.check
index 9f9f7f1ced..266d92c765 100644
--- a/test/files/neg/implicits.check
+++ b/test/files/neg/implicits.check
@@ -1,4 +1,7 @@
-implicits.scala:21: error: ambiguous implicit value:
+implicits.scala:21: error: type mismatch;
+ found : Pos
+ required: ?{val +: ?}
+Note that implicit conversions are not applicable because they are ambiguous:
most specific definition is: method pos2int in object Super of type (Pos)scala.Int
yet alternative definition method any2plus in object Sub of type (scala.Any)Sub.Plus
is defined in a subclass.
diff --git a/test/files/neg/nopredefs.check b/test/files/neg/nopredefs.check
new file mode 100644
index 0000000000..0a0ab34482
--- /dev/null
+++ b/test/files/neg/nopredefs.check
@@ -0,0 +1,4 @@
+nopredefs.scala:5: error: not found: value Set
+ val y = Set(3)
+ ^
+one error found
diff --git a/test/files/neg/nopredefs.scala b/test/files/neg/nopredefs.scala
new file mode 100644
index 0000000000..1128b18934
--- /dev/null
+++ b/test/files/neg/nopredefs.scala
@@ -0,0 +1,6 @@
+import Predef.{Set => _, _}
+
+object Test {
+ val x = Map(1 -> 2)
+ val y = Set(3)
+}
diff --git a/test/files/neg/viewtest.check b/test/files/neg/viewtest.check
index d84d03fe24..2b1b2c4cbc 100644
--- a/test/files/neg/viewtest.check
+++ b/test/files/neg/viewtest.check
@@ -3,7 +3,7 @@ viewtest.scala:43: error: type mismatch;
required: scala.List[a(in method view3)]
case y1: List[a] => compareLists(x, y1)
^
-viewtest.scala:104: error: ambiguous implicit value:
+viewtest.scala:104: error: ambiguous implicit values:
both method view4 in object O of type [a](a)a
and method identity in object Predef of type [a](a)a
match expected type (test.Str) => test.Ordered[test.Str]
diff --git a/test/files/pos/bug911.scala b/test/files/pos/bug911.scala
new file mode 100644
index 0000000000..224b14cda3
--- /dev/null
+++ b/test/files/pos/bug911.scala
@@ -0,0 +1,6 @@
+object Test {
+def foo : Any = {
+ case class Foo {}
+ Foo;
+}
+}