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

fe: Add support for nested lazy values, fix #1665 #1672

Merged
merged 3 commits into from
Jul 3, 2023
Merged

fe: Add support for nested lazy values, fix #1665 #1672

merged 3 commits into from
Jul 3, 2023

Conversation

fridis
Copy link
Member

@fridis fridis commented Jun 30, 2023

The problem essentially was that in nested calls, actual arguments of inner calls were mapped before outer calls, which results in wrong outer features for the instances of Lazy created.

This patch solves this by

  • splitting up wrapInLazyAndThenPropagateExpectedType (what was named the wrong way around) into two phases: propagateExpectedType and wrapInLazy

  • changing the order for wrapInLazy to process outer calls before actuals in inner calls.

As a bonus, this patch adds support for automatic wrapInLazy for assignments to fields such as

  i Lazy i32 := f x

A regression test testing three levels of nested lazy arguments and lazy assignments to fields is also added.

The problem essentially was that in nested calls, actual arguments of inner
calls were mapped before outer calls, which results in wrong outer features for
the instances of Lazy created.

This patch solves this by

- splitting up wrapInLazyAndThenPropagateExpectedType (what was named the wrong
  way around) into two phases: propagateExpectedType and wrapInLazy

- changing the order for wrap*InLazy to process outer calls before actuals in
  inner calls.

As a bonus, this patch adds support for automatic wrapInLazy for assignments
to fields such as

  i Lazy i32 := f x

A regression test testing three levels of nested lazy arguments and lazy
assignments to fields is also added.
@fridis fridis requested a review from maxteufel June 30, 2023 14:55
@fridis fridis merged commit 59f3f3d into main Jul 3, 2023
5 checks passed
@fridis fridis deleted the fix_1665 branch July 3, 2023 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants