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

Detect cyclic field definitions in struct dependency graph #704

Merged
merged 1 commit into from
May 10, 2022

Conversation

Narasimha1997
Copy link
Contributor

What was wrong?

As stated by @Y-Nak in the issue #682

How was it fixed?

By adding struct_cycles as salsa cycle callback that throws an error when cycles are detected.

@codecov-commenter
Copy link

codecov-commenter commented May 8, 2022

Codecov Report

Merging #704 (1b5a991) into master (4aa56e2) will decrease coverage by 0.07%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #704      +/-   ##
==========================================
- Coverage   82.05%   81.98%   -0.08%     
==========================================
  Files         125      125              
  Lines       10876    10950      +74     
==========================================
+ Hits         8924     8977      +53     
- Misses       1952     1973      +21     
Impacted Files Coverage Δ
crates/analyzer/src/db.rs 100.00% <ø> (ø)
crates/analyzer/src/db/queries/structs.rs 77.47% <100.00%> (+2.73%) ⬆️
crates/analyzer/src/namespace/items.rs 92.64% <100.00%> (+0.11%) ⬆️
crates/parser/src/grammar/functions.rs 88.40% <0.00%> (-2.12%) ⬇️
crates/yulgen/src/mappers/expressions.rs 88.65% <0.00%> (-2.11%) ⬇️
crates/parser/src/ast.rs 87.53% <0.00%> (-1.01%) ⬇️
crates/analyzer/src/context.rs 61.34% <0.00%> (-0.85%) ⬇️
crates/lowering/src/mappers/functions.rs 99.42% <0.00%> (+<0.01%) ⬆️
crates/test-utils/src/lib.rs 89.63% <0.00%> (+0.03%) ⬆️
crates/analyzer/src/traversal/expressions.rs 80.86% <0.00%> (+0.10%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4aa56e2...1b5a991. Read the comment docs.

Copy link
Member

@Y-Nak Y-Nak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening the PR.
The implementation itself is perfect 💯

nits:

  1. Could you add close #682 to the PR comment to close the issue automatically when the PR is merged?
  2. Could you add newsfragments/682.bugfix.md to ensure the fix will be included in the next release note?

@Narasimha1997
Copy link
Contributor Author

@Y-Nak
Yup, did the changes you suggested.

@Y-Nak
Copy link
Member

Y-Nak commented May 10, 2022

Thanks so much!

@Y-Nak Y-Nak merged commit 9381e49 into ethereum:master May 10, 2022
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.

3 participants