Skip to content

Internal compiler error in new list comprehension features #10002

Open
@UlfNorell

Description

@UlfNorell

Describe the bug
Internal error in compiler using <:- and &&.

To Reproduce
Compiling the following module

-module(bug).
-export([bug/0]).
bug() ->
  [X || X <:- [] && #{key1 := X, key2 := _} <- [] ].

results in the error

Function: bug/0
bug.erl: internal error in pass core:
exception error: no function clause matching v3_core:cpat_map_pairs([{c_var,[],12}]) 
  in function  v3_core:cpat_map_pairs/1 (v3_core.erl:3725)
  in call from v3_core:cpattern/1 (v3_core.erl:3715)
  in call from v3_core:cpattern/1 (v3_core.erl:3711)
  in call from v3_core:cpattern_list/1 (v3_core.erl:3705)
  in call from v3_core:cpattern_list/1 (v3_core.erl:3705)
  in call from v3_core:cclause/3 (v3_core.erl:3691)
  in call from lists:mapfoldl_1/3 (lists.erl:2673)
{error,[error]}

Expected behavior
Successful compilation.

Affected versions
OTP-28.0.1

Metadata

Metadata

Assignees

Labels

bugIssue is reported as a bugteam:VMAssigned to OTP team VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions