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

ast/tests: Repeat type resolution for arguments in lambda to fix #3315 and fix #3308 #3318

Merged
merged 7 commits into from
Jul 8, 2024

Conversation

fridis
Copy link
Member

@fridis fridis commented Jul 5, 2024

The type resolution has top be repeated for actual arguments in a lambda, lazy or partial call since the outer feature has changed.

For this to work, the code that assigns the initial value to a field must be created later, i.e, not during resolveTypes but in phase syntaxSugar1.

The issue from #3315 is no longer commented out in tests/reg_issue3308 and an even simpler example was added as well. This PR also adds new test cases with outer feature being a function and not a constructor. This includes a commented-out version of the example in #3324, which does not work yet.

The type resolution was missing for arguments in a partial call.

The type feature is required as well and is created explicitly, marked this with
NYI since it is unclear why this does not happen automatically.

The issue from #3315 is no longer commented out in tests/reg_issue3308 and an
even simpler example was added as well.
@fridis fridis marked this pull request as draft July 5, 2024 11:49
@fridis fridis changed the title ast/tests: Add type resolution for lambda to fix #3315 fix #3308 ast/tests: Add type resolution for lambda to fix #3315 and fix #3308 Jul 5, 2024
…caton

The actual arguments' types must be resolved again if the outer type they were
resolved again has changed due to lambda, lazy or partial application.

Added new field `Call._actualsResolvedFor` the detect the need to re-resolve the
actual argument types.

Move syntax sugar for field initialization form `RESOLVING_TYPES` phase to
`SYNTAX_SUGAR1` phase to properly separate this in case the field initial value
ends up being a lambda/lazy/partial.
Also duplicated the tests in `reg_issue3308` to be executed within a function
`b` additionally to the constructor `a`.  This includes the case from #3324,
which is currently commented out in the test.
@fridis fridis marked this pull request as ready for review July 7, 2024 13:06
Do not set `Call._actualsResolvedFor` to null if the outer has changed and the
actuals will get re-resolved anyway.
@fridis fridis changed the title ast/tests: Add type resolution for lambda to fix #3315 and fix #3308 ast/tests: Repeat type resolution for arguments in lambda to fix #3315 and fix #3308 Jul 7, 2024
@michaellilltokiwa michaellilltokiwa merged commit 1607225 into main Jul 8, 2024
5 checks passed
@maxteufel maxteufel deleted the fix_3315 branch August 20, 2024 07:35
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.

2 participants