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: handling of default values in entry point of call graph computation #797

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

lars-reimann
Copy link
Member

@lars-reimann lars-reimann commented Nov 24, 2023

Summary of Changes

Consider the following code:

@Pure fun default() -> r: Any

segment mySegment(param: () -> () = default) {
    »param()«;
}

When computing the call graph for the param() call, we were previously always substituting param with its default value, since the parameter substitutions were empty in the entry point. Because of this, we were incorrectly considering the param() call as pure, just like the segment mySegment.

Copy link

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ REPOSITORY git_diff yes no 0.07s
✅ TYPESCRIPT eslint 1 0 0 3.91s
✅ TYPESCRIPT prettier 1 0 0 0.73s

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 Nov 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5017759) 100.00% compared to head (b2a5d8c) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #797   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           86        86           
  Lines        13497     13505    +8     
  Branches      2855      2860    +5     
=========================================
+ Hits         13497     13505    +8     

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

@lars-reimann lars-reimann marked this pull request as ready for review November 24, 2023 20:15
@lars-reimann lars-reimann merged commit a5db23c into main Nov 24, 2023
10 checks passed
@lars-reimann lars-reimann deleted the call-graph-default-value-fix branch November 24, 2023 20:15
lars-reimann pushed a commit that referenced this pull request Nov 25, 2023
## [0.5.0](v0.4.0...v0.5.0) (2023-11-25)

### Features

* error if index of indexed access is invalid ([#796](#796)) ([5017759](5017759)), closes [#16](#16)
* full implementation of partial evaluator ([#798](#798)) ([7643794](7643794)), closes [#603](#603)
* settings to hide selected warnings/infos ([#795](#795)) ([ff7c23a](ff7c23a)), closes [#35](#35)

### Bug Fixes

* handling of default values in entry point of call graph computation ([#797](#797)) ([a5db23c](a5db23c))
@lars-reimann
Copy link
Member Author

🎉 This PR is included in version 0.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Nov 25, 2023
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