Skip to content

Michelson: empty type

Raphaël Cauderlier requested to merge rafoo@empty_type into proto-proposal

Enrich the Michelson type system by an empty type called never as requested here: Fixes tezos/tezos#662 (closed) The NEVER instruction can close absurd branches with a top stack element of type never.

I wrote the commits so that we can choose to drop the NEVER instruction if we find it too redundant with FAILWITH.

On possible constraints on the type (packability, storability, etc...), I agree with @Martoon that no constraint is needed so I have implemented none. In particular, type never is comparable.

Internally, the type is represented using an empty OCaml type defined by type never = | in script_typed_ir.ml.

Edited by Raphaël Cauderlier

Merge request reports