summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-23 10:29:13 -0800
committerPaul Phillips <paulp@improving.org>2012-02-23 10:29:13 -0800
commit17a84df3db5c3dfaf36e05ac1b65bb0d1b39442a (patch)
tree8994c2a45a876887c6c9df0e73fcc672a1622c37 /test
parent382a16e948b146c6e32a4c9e7f01fb2624717e57 (diff)
parent6e7e4bb6b86c505a43214cc0c74668acefb54c1a (diff)
downloadscala-17a84df3db5c3dfaf36e05ac1b65bb0d1b39442a.tar.gz
scala-17a84df3db5c3dfaf36e05ac1b65bb0d1b39442a.tar.bz2
scala-17a84df3db5c3dfaf36e05ac1b65bb0d1b39442a.zip
Merge remote-tracking branch 'adriaanm/ticket/errortests'
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/error_dependentMethodTpeConversionToFunction.check4
-rw-r--r--test/files/neg/error_dependentMethodTpeConversionToFunction.scala5
-rw-r--r--test/files/neg/error_tooManyArgsPattern.check4
-rw-r--r--test/files/neg/error_tooManyArgsPattern.scala5
-rw-r--r--test/files/neg/t960.check5
-rw-r--r--test/files/neg/t960.scala4
6 files changed, 26 insertions, 1 deletions
diff --git a/test/files/neg/error_dependentMethodTpeConversionToFunction.check b/test/files/neg/error_dependentMethodTpeConversionToFunction.check
new file mode 100644
index 0000000000..3496a552c4
--- /dev/null
+++ b/test/files/neg/error_dependentMethodTpeConversionToFunction.check
@@ -0,0 +1,4 @@
+error_dependentMethodTpeConversionToFunction.scala:4: error: method with dependent type (x: AnyRef)x.type cannot be converted to function value
+ val x: Any => Any = foo
+ ^
+one error found
diff --git a/test/files/neg/error_dependentMethodTpeConversionToFunction.scala b/test/files/neg/error_dependentMethodTpeConversionToFunction.scala
new file mode 100644
index 0000000000..22649e5098
--- /dev/null
+++ b/test/files/neg/error_dependentMethodTpeConversionToFunction.scala
@@ -0,0 +1,5 @@
+// test DependentMethodTpeConversionToFunctionError
+object Test {
+ def foo(x: AnyRef): x.type = x
+ val x: Any => Any = foo
+} \ No newline at end of file
diff --git a/test/files/neg/error_tooManyArgsPattern.check b/test/files/neg/error_tooManyArgsPattern.check
new file mode 100644
index 0000000000..ee401ad061
--- /dev/null
+++ b/test/files/neg/error_tooManyArgsPattern.check
@@ -0,0 +1,4 @@
+error_tooManyArgsPattern.scala:3: error: too many arguments for unapply pattern, maximum = 22
+ case List(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23) => 7
+ ^
+one error found
diff --git a/test/files/neg/error_tooManyArgsPattern.scala b/test/files/neg/error_tooManyArgsPattern.scala
new file mode 100644
index 0000000000..d55ba61001
--- /dev/null
+++ b/test/files/neg/error_tooManyArgsPattern.scala
@@ -0,0 +1,5 @@
+object Test {
+ def test(xs: Any) = xs match { // test error message TooManyArgsPatternError
+ case List(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23) => 7
+ }
+}
diff --git a/test/files/neg/t960.check b/test/files/neg/t960.check
index d65b0cea93..4cc76d3602 100644
--- a/test/files/neg/t960.check
+++ b/test/files/neg/t960.check
@@ -4,7 +4,10 @@ and method unapply in object List of type [a](xs: List[a])Option[(a, List[a])]
match argument types (List[a])
case List(x, xs) => 7
^
+t960.scala:22: error: cannot resolve overloaded unapply
+ case List(x, xs) => 7
+ ^
t960.scala:12: error: method unapply is defined twice
def unapply[a](xs: List[a]): Option[Null] = xs match {
^
-two errors found
+three errors found \ No newline at end of file
diff --git a/test/files/neg/t960.scala b/test/files/neg/t960.scala
index 5101cf8433..36909626c1 100644
--- a/test/files/neg/t960.scala
+++ b/test/files/neg/t960.scala
@@ -17,4 +17,8 @@ object List {
def foo[a](xs: List[a]) = xs match {
case List(x, xs) => 7
}
+
+ def bar(xs: Any) = xs match { // test error message OverloadedUnapplyError
+ case List(x, xs) => 7
+ }
}