summaryrefslogtreecommitdiff
path: root/test/files/pos/channels.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-01-16 20:33:20 +0000
committerMartin Odersky <odersky@gmail.com>2007-01-16 20:33:20 +0000
commit6093bbedc0c0cf39650c4cd931afb18feb1bcda8 (patch)
tree3c812fab17a33c73b6ce03bb9129d0674dd1b6bf /test/files/pos/channels.scala
parent96376cd15412c66bcd30e9b397f211eec4e7bf35 (diff)
downloadscala-6093bbedc0c0cf39650c4cd931afb18feb1bcda8.tar.gz
scala-6093bbedc0c0cf39650c4cd931afb18feb1bcda8.tar.bz2
scala-6093bbedc0c0cf39650c4cd931afb18feb1bcda8.zip
enabled -Xunapply.
fixed bug contrib 291. Added Map/Set types to Predef. Option no longer inherits from Iterable, but there's an implicit conversion. various other small things.
Diffstat (limited to 'test/files/pos/channels.scala')
-rw-r--r--test/files/pos/channels.scala30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/files/pos/channels.scala b/test/files/pos/channels.scala
new file mode 100644
index 0000000000..6513f3a5f0
--- /dev/null
+++ b/test/files/pos/channels.scala
@@ -0,0 +1,30 @@
+class Channel[a]
+
+import collection.mutable.Set
+
+case class ![a](chan: Channel[a], data: a)
+
+/*
+object Bang {
+ def unapply[a](x: ![a]): Option[{Channel[a], a}] =
+ Some(x.chan, x.data)
+}
+
+*/
+object Test extends Application {
+ object IC extends Channel[int]
+ def f[b](x: ![b]): int = x match {
+ case send: ![c] =>
+ send.chan match {
+ case IC => send.data
+ }
+ }
+}
+
+object Test2 extends Application {
+ object IC extends Channel[Set[int]]
+ def f[b](s: ![b]): Set[int] = s match {
+ case IC ! x => x
+ }
+}
+