Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Exhaustiveness checking #1

@michallepicki

Description

@michallepicki

Is there a plan to have exhaustiveness checking of case expressions?

Currently this code doesn't result in any errors:

-module(testmod).
-export([testfun/0]).

-spec testfun() -> pos_integer().
testfun() ->
  case a() of
    ok -> 1
  end.

-spec a() -> ok | number().
a() ->
  case rand:uniform(10) rem 2 of
    0 -> ok;
    1 -> 1
  end.
$ rebar3 compile
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling myapp
$ elp eqwalize-all
  Loading rebar3 build_info
  Loading applications      ████████████████████ 2/2
  Seeding database
  Compiling dependencies
NO ERRORS

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions