ceylon/ceylon-spec — Issue #167: switch example in 5.3.9 is wrong
Author: chochos
Created: 2012-02-08 00:24:31+00:00
State: open

The first example of `switch` has a `case(null)` which doesn't compile in something like this:

````
abstract class SwitchTest1() of testcase1|testcase2|testcase3 {}
object testcase1 extends SwitchTest1(){}
object testcase2 extends SwitchTest1(){}
object testcase3 extends SwitchTest1(){}

String test(SwitchTest1? st) {
switch(st)
case (null) { return "No case"; }
else { return "case"; }
}
````

The error is `case type must be a case of the switch type: Nothing is not assignable to nothing|testcase1|testcase2|testcase3`. If I use `nothing` instead of `null` it compiles... but isn't `nothing` supposed to be private to the `ceylon.language` package?