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

#to:do: optimization evaluates argument before receiver #16927

Open
j-brant opened this issue Jul 19, 2024 · 1 comment · May be fixed by #16956
Open

#to:do: optimization evaluates argument before receiver #16927

j-brant opened this issue Jul 19, 2024 · 1 comment · May be fixed by #16956
Assignees

Comments

@j-brant
Copy link
Contributor

j-brant commented Jul 19, 2024

Bug description
The first argument of the to:do: message send is evaluated before the receiver.

To Reproduce
Evaluate:

| stream results |
results := OrderedCollection new.
stream := #( 1 5 ) readStream.
stream next to: stream next do: [ :i | results add: i ].
results

This should return an ordered collection with numbers 1 to 5, but instead returns an empty collection as the to: argument is evaluated before the receiver.

Expected behavior
The receiver of the message should be evaluated before an arguments like happens with non-optimized messages.

Version information:

  • Pharo Version: Pharo 13 (and 10 and likely most other versions).
@MarcusDenker MarcusDenker self-assigned this Jul 22, 2024
@MarcusDenker
Copy link
Member

Thanks, I will check

MarcusDenker added a commit to MarcusDenker/pharo that referenced this issue Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants