diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/channels.scala | 30 | ||||
-rw-r--r-- | test/pending/pos/unapplyComplex.scala | 2 | ||||
-rw-r--r-- | test/pending/run/unapply.scala | 2 |
3 files changed, 32 insertions, 2 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 + } +} + diff --git a/test/pending/pos/unapplyComplex.scala b/test/pending/pos/unapplyComplex.scala index 0d5700a3be..54080eb86f 100644 --- a/test/pending/pos/unapplyComplex.scala +++ b/test/pending/pos/unapplyComplex.scala @@ -29,7 +29,7 @@ object Test { Console.println("mod"+mod+"arg"+arg) } val Komplex = ComplexRect - new ComplexPolar(Math.sqrt(2),Math.PI / 4.0) match { + new ComplexPolar(Math.sqrt(2),Math.Pi / 4.0) match { case Komplex(re,im) => // z @ ??? Console.println("re"+re+" im"+im) } diff --git a/test/pending/run/unapply.scala b/test/pending/run/unapply.scala index e00a1e63a0..d84711519f 100644 --- a/test/pending/run/unapply.scala +++ b/test/pending/run/unapply.scala @@ -79,7 +79,7 @@ object Mas extends Assert { object Lis extends Assert { def run { - assertEquals(List(1,2,3) match { case List(x,y,_*) => {x,y}}, {1,2}) + assertEquals((List(1,2,3): Any) match { case List(x,y,_*) => {x,y}}, {1,2}) } } |