summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2010-03-08 13:46:13 +0000
committerMartin Odersky <odersky@gmail.com>2010-03-08 13:46:13 +0000
commitb7c17993c61d453c3069a14d66ada6fb7c3301c4 (patch)
tree08ac810ecadc86c71326f6797c6e95a9465a8209 /test/files/neg
parentb10b2834985eb2e7f6e152790e630c922b0c119c (diff)
downloadscala-b7c17993c61d453c3069a14d66ada6fb7c3301c4.tar.gz
scala-b7c17993c61d453c3069a14d66ada6fb7c3301c4.tar.bz2
scala-b7c17993c61d453c3069a14d66ada6fb7c3301c4.zip
new tests
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/t3015.check11
-rw-r--r--test/files/neg/t3015.scala8
-rw-r--r--test/files/neg/t3115.check10
-rwxr-xr-xtest/files/neg/t3115.scala9
4 files changed, 38 insertions, 0 deletions
diff --git a/test/files/neg/t3015.check b/test/files/neg/t3015.check
new file mode 100644
index 0000000000..32809b0669
--- /dev/null
+++ b/test/files/neg/t3015.check
@@ -0,0 +1,11 @@
+t3015.scala:7: error: scrutinee is incompatible with pattern type;
+ found : _$1 where type _$1
+ required: java.lang.String
+ val b(foo) = "foo"
+ ^
+t3015.scala:7: error: type mismatch;
+ found : _$1(in value foo) where type _$1(in value foo) <: java.lang.String
+ required: (some other)_$1(in value foo) where type (some other)_$1(in value foo)
+ val b(foo) = "foo"
+ ^
+two errors found
diff --git a/test/files/neg/t3015.scala b/test/files/neg/t3015.scala
new file mode 100644
index 0000000000..0bd53e7a03
--- /dev/null
+++ b/test/files/neg/t3015.scala
@@ -0,0 +1,8 @@
+class UnApp[P] {
+ def unapply(a: P): Option[P] = Some(a)
+}
+
+object Test extends Application {
+ val b: UnApp[_] = new UnApp[String]
+ val b(foo) = "foo"
+}
diff --git a/test/files/neg/t3115.check b/test/files/neg/t3115.check
new file mode 100644
index 0000000000..a5b97d71df
--- /dev/null
+++ b/test/files/neg/t3115.check
@@ -0,0 +1,10 @@
+t3115.scala:6: warning: object Math in object sc is deprecated:
+ println(sc.Math)
+ ^
+t3115.scala:7: warning: object Math in package scala is deprecated: use scala.math package instead
+ println(scala.Math)
+ ^
+t3115.scala:8: warning: object Math in package scala is deprecated: use scala.math package instead
+ scala.Math.Pi
+ ^
+three warnings found
diff --git a/test/files/neg/t3115.scala b/test/files/neg/t3115.scala
new file mode 100755
index 0000000000..4aeeb4063e
--- /dev/null
+++ b/test/files/neg/t3115.scala
@@ -0,0 +1,9 @@
+object sc {
+ @deprecated("") object Math
+}
+
+object Test {
+ println(sc.Math)
+ println(scala.Math)
+ scala.Math.Pi
+}