Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in typechecker:do_type_check_expr_in/3: bad_key in map_get/2 #545

Open
RobinMorisset opened this issue Jun 7, 2023 · 0 comments
Open
Labels

Comments

@RobinMorisset
Copy link

Running gradualizer on the following Erlang code:

f() ->
    (abs(_V0 = erlang:abs(erlang:abs(1.0))) =:= ok) orelse is_map_key(_V0, ok).

results in the following crash:

escript: exception error: bad key: '_V0'
  in function  map_get/2
     called as map_get('_V0',#{})
     *** argument 1: not present in map
  in call from typechecker:do_type_check_expr_in/3 (src/typechecker.erl, line 2526)
  in call from typechecker:type_check_expr_in/3 (src/typechecker.erl, line 2514)
  in call from typechecker:'-type_check_call_ty/4-lc$^0/1-0-'/2 (src/typechecker.erl, line 2302)
  in call from typechecker:type_check_call_ty/4 (src/typechecker.erl, line 2303)
  in call from typechecker:do_type_check_expr/2 (src/typechecker.erl, line 1843)
  in call from typechecker:type_check_expr/2 (src/typechecker.erl, line 1714)
  in call from typechecker:type_check_logic_op/4 (src/typechecker.erl, line 2204)
@erszcz erszcz added the bug label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants