Pattern Inference
type:changed
This MR improves the type inference of patterns by adding "pattern inference".
Previously patterns were only checked, thus any complex pattern (e.g. a tuple, record, variant, etc) required an annotation. Pattern inference (like inference for expressions) relaxes this restriction allowing us to infer the type of a pattern from its structure.
For example, the following now type checks:
let add (x, y) = x + y
Whereas previously, we would require:
let add ((x, y) : int * int) = x + y
Future work:
- Update the type system formalisation adding pattern inference alistair.obrien/ligo-type-system#3
Changelog details:
Add pattern inference
Edited by Alistair O'Brien