ceylon/ceylon-spec — Issue #151: Question about type parameters
Author: OneCheese
Created: 2012-01-27 13:14:10+00:00
State: open

Hello,

I tried to understand the example used in http://ceylon-lang.org/blog/2012/01/26/generic-enumerated-types/ but failed for this one:

```java
Num increment(Num x)
given Num of Integer|Float {
switch (x)
case (is Integer) { return x+1; }
case (is Float) { return x+1.0; }
}
```

Could you explain exactly why this is not correct?