ceylon/ceylon.language — Issue #50: Overflow and ++/--
Author: tombentley
Created: 2012-02-15 08:37:56+00:00
State: open

`Ordinal.successor` and `Ordinal.predecessor` are documented to throw `OverflowException`. Since `++` and `--` are defined in terms of `Ordinal` this leads to the unintuitive fact that `x++` can throw but `x := x + 1` never will. Is this what we want?

Secondly, the compiler optimizes `++` and `--` on `Integer` to a Java `++`/`--`, so that overflow won't be detected. Which makes things even more unintuitive.