Skip to content

zip generator + strict generator: different behaviour in erlc and shell #9435

Open
@ilya-klyuchnikov

Description

Describe the bug
A certain (edge-case) expression is evaluated differently when compiled and from shell

To Reproduce

-module(c1).

-export([test/0]).

test() -> [Y || Y <- [a] && Y <:- [b]].
Erlang/OTP 28 [RELEASE CANDIDATE 1] [erts-16.0] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1]

Eshell V16.0 (press Ctrl+G to abort, type help(). for help)
1> c1:test().
[]
2> [Y || Y <- [a] && Y <:- [b]].
** exception error: bad generators: {[a],[b]}

Expected behavior
The same behavior in erlc and shell.

(The subtlety is simultaneous binding of Y vars in parallel generators).

Affected versions
28-rc1

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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