summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-09-01 07:45:41 -0700
committerPaul Phillips <paulp@improving.org>2012-09-01 08:29:16 -0700
commit835405ba4582b7d70e8bd31504d3d2ffaebe28a7 (patch)
tree9615846a0ec707e62884c600e5c1f823124221f5 /test/files/neg
parentc4e055c02125ebdcb91b7231f19995bb9dec0fd7 (diff)
parentd5a5142b9858920cd9a5dbf0ca1ceebb8131aceb (diff)
downloadscala-835405ba4582b7d70e8bd31504d3d2ffaebe28a7.tar.gz
scala-835405ba4582b7d70e8bd31504d3d2ffaebe28a7.tar.bz2
scala-835405ba4582b7d70e8bd31504d3d2ffaebe28a7.zip
Merge remote-tracking branch 'origin/2.10.x' into merge-210
# By Ruediger Klaehn (14) and others # Via Josh Suereth (13) and others * origin/2.10.x: (49 commits) More useful -Xlog-implicits output. Reflection tuning Two more value classes. Fixed cloning a double-linked list. Expanded the reach of value classes. Added/fixed test files for SI-6227 Two fixes for the worksheet instrumenter Fix crasher from bug in maven ant tasks. Yippie. Closes SI-6227 Fix for SI-6283, no abstract value classes. hotfix for SI-6293 Commented out assertions removes Symbol.kind and Type.kind Add missing tests for SI-6190 SI-6281 macroArgs for defs with implicit args SI-6280 Scaladoc: Reloading preserves anchors Added test to ensure that ListMap.tail is O(1) Made ListMap.tail O(1) instead of O(N) SI-6052 - fix groupBy on parallel collections SI-6272 Support lazy vals defined in try in template. ...
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/implicit-shadow.check11
-rw-r--r--test/files/neg/implicit-shadow.flags1
-rw-r--r--test/files/neg/implicit-shadow.scala13
-rw-r--r--test/files/neg/javaConversions-2.10-ambiguity.check6
-rw-r--r--test/files/neg/javaConversions-2.10-ambiguity.scala10
-rw-r--r--test/files/neg/t6227.check4
-rw-r--r--test/files/neg/t6227.scala6
-rw-r--r--test/files/neg/t6264.check6
-rw-r--r--test/files/neg/t6264.flags1
-rw-r--r--test/files/neg/t6264.scala6
-rw-r--r--test/files/neg/t6283.check4
-rw-r--r--test/files/neg/t6283.scala1
-rw-r--r--test/files/neg/t900.check4
-rw-r--r--test/files/neg/unit2anyref.check2
14 files changed, 69 insertions, 6 deletions
diff --git a/test/files/neg/implicit-shadow.check b/test/files/neg/implicit-shadow.check
new file mode 100644
index 0000000000..042fca867a
--- /dev/null
+++ b/test/files/neg/implicit-shadow.check
@@ -0,0 +1,11 @@
+implicit-shadow.scala:4: <i2s: error> is not a valid implicit value for Int(1) => ?{def isEmpty: ?} because:
+reference to i2s is ambiguous;
+it is imported twice in the same scope by
+import C._
+and import B._
+ 1.isEmpty
+ ^
+implicit-shadow.scala:4: error: value isEmpty is not a member of Int
+ 1.isEmpty
+ ^
+one error found
diff --git a/test/files/neg/implicit-shadow.flags b/test/files/neg/implicit-shadow.flags
new file mode 100644
index 0000000000..44842a9d65
--- /dev/null
+++ b/test/files/neg/implicit-shadow.flags
@@ -0,0 +1 @@
+-Xlog-implicits
diff --git a/test/files/neg/implicit-shadow.scala b/test/files/neg/implicit-shadow.scala
new file mode 100644
index 0000000000..ffd34b6408
--- /dev/null
+++ b/test/files/neg/implicit-shadow.scala
@@ -0,0 +1,13 @@
+object Test {
+ import B._, C._
+
+ 1.isEmpty
+}
+
+trait A {
+ implicit def i2s(i: Int): String = ""
+}
+
+object B extends A
+
+object C extends A \ No newline at end of file
diff --git a/test/files/neg/javaConversions-2.10-ambiguity.check b/test/files/neg/javaConversions-2.10-ambiguity.check
new file mode 100644
index 0000000000..c064a22964
--- /dev/null
+++ b/test/files/neg/javaConversions-2.10-ambiguity.check
@@ -0,0 +1,6 @@
+javaConversions-2.10-ambiguity.scala:8: error: type mismatch;
+ found : scala.collection.concurrent.Map[String,String]
+ required: scala.collection.mutable.ConcurrentMap[String,String]
+ assertType[mutable.ConcurrentMap[String, String]](a)
+ ^
+one error found
diff --git a/test/files/neg/javaConversions-2.10-ambiguity.scala b/test/files/neg/javaConversions-2.10-ambiguity.scala
new file mode 100644
index 0000000000..e856846a29
--- /dev/null
+++ b/test/files/neg/javaConversions-2.10-ambiguity.scala
@@ -0,0 +1,10 @@
+import collection.{JavaConversions, mutable, concurrent}
+import JavaConversions._
+import java.util.concurrent.{ConcurrentHashMap => CHM}
+
+object Bar {
+ def assertType[T](t: T) = t
+ val a = new CHM[String, String]() += (("", ""))
+ assertType[mutable.ConcurrentMap[String, String]](a)
+}
+// vim: set et:
diff --git a/test/files/neg/t6227.check b/test/files/neg/t6227.check
new file mode 100644
index 0000000000..5e3c636712
--- /dev/null
+++ b/test/files/neg/t6227.check
@@ -0,0 +1,4 @@
+t6227.scala:2: error: illegal combination of modifiers: implicit and case for: class IntOps
+ implicit case class IntOps( i: Int ) {
+ ^
+one error found
diff --git a/test/files/neg/t6227.scala b/test/files/neg/t6227.scala
new file mode 100644
index 0000000000..46416839d1
--- /dev/null
+++ b/test/files/neg/t6227.scala
@@ -0,0 +1,6 @@
+object Test {
+ implicit case class IntOps( i: Int ) {
+ def twice = i * 2
+ }
+}
+
diff --git a/test/files/neg/t6264.check b/test/files/neg/t6264.check
new file mode 100644
index 0000000000..c0975a80b2
--- /dev/null
+++ b/test/files/neg/t6264.check
@@ -0,0 +1,6 @@
+t6264.scala:3: warning: non-variable type argument Tuple1[_] in type Tuple2[_, Tuple1[_]] is unchecked since it is eliminated by erasure
+ x.isInstanceOf[Tuple2[_, Tuple1[_]]]
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t6264.flags b/test/files/neg/t6264.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/neg/t6264.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/neg/t6264.scala b/test/files/neg/t6264.scala
new file mode 100644
index 0000000000..dc3b727934
--- /dev/null
+++ b/test/files/neg/t6264.scala
@@ -0,0 +1,6 @@
+class Foo {
+ def foo(x: AnyRef): Unit = {
+ x.isInstanceOf[Tuple2[_, Tuple1[_]]]
+ ()
+ }
+}
diff --git a/test/files/neg/t6283.check b/test/files/neg/t6283.check
new file mode 100644
index 0000000000..69e417ee93
--- /dev/null
+++ b/test/files/neg/t6283.check
@@ -0,0 +1,4 @@
+t6283.scala:1: error: `abstract' modifier cannot be used with value classes
+abstract class Funky(val i: Int) extends AnyVal
+ ^
+one error found
diff --git a/test/files/neg/t6283.scala b/test/files/neg/t6283.scala
new file mode 100644
index 0000000000..d41eb18a74
--- /dev/null
+++ b/test/files/neg/t6283.scala
@@ -0,0 +1 @@
+abstract class Funky(val i: Int) extends AnyVal
diff --git a/test/files/neg/t900.check b/test/files/neg/t900.check
index 4611ceba8c..ff5304a135 100644
--- a/test/files/neg/t900.check
+++ b/test/files/neg/t900.check
@@ -1,10 +1,6 @@
t900.scala:4: error: type mismatch;
found : Foo.this.x.type (with underlying type Foo.this.bar)
required: AnyRef
-Note that implicit conversions are not applicable because they are ambiguous:
- both method any2stringfmt in object Predef of type (x: Any)scala.runtime.StringFormat
- and method any2stringadd in object Predef of type (x: Any)scala.runtime.StringAdd
- are possible conversion functions from Foo.this.x.type to AnyRef
def break(): x.type
^
one error found
diff --git a/test/files/neg/unit2anyref.check b/test/files/neg/unit2anyref.check
index 10fe1861f5..6d11461700 100644
--- a/test/files/neg/unit2anyref.check
+++ b/test/files/neg/unit2anyref.check
@@ -1,8 +1,6 @@
unit2anyref.scala:2: error: type mismatch;
found : Unit
required: AnyRef
-Note: Unit is not implicitly converted to AnyRef. You can safely
-pattern match `x: AnyRef` or cast `x.asInstanceOf[AnyRef]` to do so.
val x: AnyRef = () // this should not succeed.
^
one error found