Skip to content

Add Error Message for Bogus Cases Branches #983

@peblair

Description

@peblair

I know that there is static information wiring that is needed to facilitate this (which I am currently working on implementing), but I wanted to make a note of something we should likely fix once we have the ability to do so. Currently, the following runs without issue:

fun foo(x):
  cases(Option) x:
    | none => 0
    | some(n) => n
    | other(f) => f
  end
end

Even worse, so does this (spot the bug!):

fun foo(x):
  cases(Option) x:
    | none => 0
    | som(n) => n
  end
where:
  foo(none) is 0
end

It would be great if we could have some form of error message (even at runtime, if necessary) for things such as these.
(Bonus points if we can have an exhastiveness-checking system like OCaml! 😄)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions