summaryrefslogtreecommitdiff
path: root/test/files/neg/t3224.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2010-04-12 11:52:39 +0000
committerMartin Odersky <odersky@gmail.com>2010-04-12 11:52:39 +0000
commitcfe47e4b74cc166af31cc130b0830112c46bdc61 (patch)
tree7716cb0c8cb0179f0b09328779e0c2ac06621025 /test/files/neg/t3224.scala
parentbed1ffb1c357e09c05ea6a58bd19a75510f1822e (diff)
downloadscala-cfe47e4b74cc166af31cc130b0830112c46bdc61.tar.gz
scala-cfe47e4b74cc166af31cc130b0830112c46bdc61.tar.bz2
scala-cfe47e4b74cc166af31cc130b0830112c46bdc61.zip
Closes #3224. Review by retronym.
Diffstat (limited to 'test/files/neg/t3224.scala')
-rwxr-xr-xtest/files/neg/t3224.scala30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/files/neg/t3224.scala b/test/files/neg/t3224.scala
new file mode 100755
index 0000000000..0e24baf28a
--- /dev/null
+++ b/test/files/neg/t3224.scala
@@ -0,0 +1,30 @@
+object Texts{
+ def textL[T](list: List[T]) = {
+ list match{
+ case List() => "Empty"
+ case List(_) => "One"
+ case List(_*) => "Many"
+ }
+ }
+
+ def textA[T](array: Array[T]) = {
+ array match{
+ case Array() => "Empty"
+ case Array(_) => "One"
+ case Array(_*) => "Many"
+ }
+ }
+}
+
+object Test extends Application {
+
+ implicit def array2list[T](array: Array[T]) = {
+ println(array.toList.size)
+ array.toList
+ }
+
+
+ println(Texts textL List()); println(Texts textL List(1)); println(Texts textL List(1, 1));
+
+ println(Texts textL Array()); println(Texts textL Array(1)); println(Texts textL Array(1, 1))
+}