Skip to content

[#154] Handle all unmatched cases in typeCheckInstr

Description

Problem: Currently typeCheckInstr in Michelson.TypeCheck.Instr contains a lot of pattern match clauses that match all valid instructions, and then one catch-all case that just reports generic error about failed instructions.

This should be replaced with pattern match on all possible instructions, to give more fine-grained error messages. For example, UPDATE should report what type it expects and what were given.

Solution: Handle all unmatched cases in typeCheckInstr and make it reports understandable and specific errors for all syntactically possible, but incorrect instructions.

Related issue(s)

Resolves #154 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Moremi Vannak

Merge request reports