diff options
author | Martin Odersky <odersky@gmail.com> | 2010-03-08 13:46:13 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2010-03-08 13:46:13 +0000 |
commit | b7c17993c61d453c3069a14d66ada6fb7c3301c4 (patch) | |
tree | 08ac810ecadc86c71326f6797c6e95a9465a8209 /test/files/neg | |
parent | b10b2834985eb2e7f6e152790e630c922b0c119c (diff) | |
download | scala-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.check | 11 | ||||
-rw-r--r-- | test/files/neg/t3015.scala | 8 | ||||
-rw-r--r-- | test/files/neg/t3115.check | 10 | ||||
-rwxr-xr-x | test/files/neg/t3115.scala | 9 |
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 +} |