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

fix: generate code for receivers outside of block lambdas #1246

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

lars-reimann
Copy link
Member

@lars-reimann lars-reimann commented Oct 31, 2024

Summary of Changes

The code that was generated for the following example was wrong:

rawData.removeRows((row) {
    yield result = row.getValue("age").eq(22).^not();
});

The code that was created for rawData was inside the body of the function created for the block lambda. Later references to rawData were, thus, unresolved.

Placeholders need a prefix, so they don't clash with Python keywords. The previous prefix, however, was a prefix of the prefixes used for receivers, yields, etc. Because of this, collisions were possible, e.g. if the user called their placeholder `receiver_0`.
For block lambdas, some method receivers are generated inside the lambda, rather than outside.
Copy link

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ REPOSITORY git_diff yes no 0.14s
✅ TYPESCRIPT eslint 1 0 0 4.72s
✅ TYPESCRIPT prettier 1 0 0 0.94s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.68%. Comparing base (28f81bd) to head (18a10ca).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1246   +/-   ##
=======================================
  Coverage   99.68%   99.68%           
=======================================
  Files         110      110           
  Lines       12487    12489    +2     
  Branches     4110     4110           
=======================================
+ Hits        12448    12450    +2     
  Misses         39       39           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lars-reimann lars-reimann merged commit 0d27e33 into main Oct 31, 2024
8 checks passed
@lars-reimann lars-reimann deleted the codegen-fixes branch October 31, 2024 13:28
lars-reimann pushed a commit that referenced this pull request Oct 31, 2024
## [0.19.0](v0.18.0...v0.19.0) (2024-10-31)

### Features

* allow use of operators for cells ([#1247](#1247)) ([2930357](2930357)), closes [#1165](#1165)
* show "print" code lens for some nullable types ([#1248](#1248)) ([492120c](492120c))

### Bug Fixes

* generate code for receivers outside of block lambdas ([#1246](#1246)) ([0d27e33](0d27e33))
@lars-reimann
Copy link
Member Author

🎉 This PR is included in version 0.19.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Included in a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant