summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t2462a.check4
-rw-r--r--test/files/neg/t2462a.scala3
-rw-r--r--test/files/neg/t2462b.check14
-rw-r--r--test/files/neg/t2462b.scala12
4 files changed, 33 insertions, 0 deletions
diff --git a/test/files/neg/t2462a.check b/test/files/neg/t2462a.check
new file mode 100644
index 0000000000..b609ec519f
--- /dev/null
+++ b/test/files/neg/t2462a.check
@@ -0,0 +1,4 @@
+implicitNotFound.scala:2: error: Cannot construct a collection of type List[String] with elements of type Int based on a collection of type List[String].
+ List(1,2,3).map[Int, List[String]](x => 1)
+ ^
+one error found
diff --git a/test/files/neg/t2462a.scala b/test/files/neg/t2462a.scala
new file mode 100644
index 0000000000..2d523b4dd8
--- /dev/null
+++ b/test/files/neg/t2462a.scala
@@ -0,0 +1,3 @@
+object Test {
+ List(1,2,3).map[Int, List[String]](x => 1)
+} \ No newline at end of file
diff --git a/test/files/neg/t2462b.check b/test/files/neg/t2462b.check
new file mode 100644
index 0000000000..ac9563878c
--- /dev/null
+++ b/test/files/neg/t2462b.check
@@ -0,0 +1,14 @@
+implicitNotFound_syntax.scala:6: warning: Invalid implicitNotFound message for trait Meh in package test:
+The type parameters Too, Elem referenced in the message of the @implicitNotFound annotation are not defined by trait Meh.
+trait Meh[-From, +To]
+ ^
+implicitNotFound_syntax.scala:9: warning: Invalid implicitNotFound message for trait Meh2 in package test:
+The type parameter Elem referenced in the message of the @implicitNotFound annotation is not defined by trait Meh2.
+trait Meh2[-From, +To]
+ ^
+implicitNotFound_syntax.scala:12: error: overriding method x in class thankyoupartest of type => Int;
+ method x needs `override' modifier
+class testmustfail extends thankyoupartest { def x = 43 }
+ ^
+two warnings found
+one error found
diff --git a/test/files/neg/t2462b.scala b/test/files/neg/t2462b.scala
new file mode 100644
index 0000000000..7a1389cc8e
--- /dev/null
+++ b/test/files/neg/t2462b.scala
@@ -0,0 +1,12 @@
+package test
+
+import scala.annotation.implicitNotFound
+
+@implicitNotFound(msg = "Cannot construct a collection of type ${Too} with elements of type ${Elem} based on a collection of type ${From}.")
+trait Meh[-From, +To]
+
+@implicitNotFound(msg = "Cannot construct a collection of type ${To} ${Elem}.")
+trait Meh2[-From, +To]
+
+class thankyoupartest { def x = 42 }
+class testmustfail extends thankyoupartest { def x = 43 }