Switch expressions spec

Gavin Bierman gavin.bierman at oracle.com
Thu Mar 28 14:35:57 UTC 2019

> On 15 Mar 2019, at 20:01, John Rose <john.r.rose at oracle.com> wrote:
> "What about some form of 1/0?"  That's a good question.
> What about it?  It completes normally with a type of int.
> Dynamically, the normal completion is never taken.
> Gavin might call that a "notional normal completion"
> (I like that word) provided to uphold the general principle
> even where static analysis proves that the Turing machine
> fails to return normally.

My basic thought would be that at least 1/0 is an expression for which I can synthesise/infer a type. I don’t know what to synthesise/infer for a switch expression with no results. Even if it were safe, I don't want to break the invariant that every expression has a type. 


More information about the amber-spec-observers mailing list