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

[Compiler] Support accessing result variable inside post conditions #3741

Merged
merged 9 commits into from
Feb 5, 2025

Conversation

SupunS
Copy link
Member

@SupunS SupunS commented Jan 28, 2025

Work towards #3742

Description

result variable gets passed as a parameter (last parameter) to the generated functions (for conditions).
e.g:

struct interface A {
    access(all) view fun $A.test.postConditions(_ a1: T1, _ a2: T2, _ result: T3): Void {
        ...
    }
}

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@SupunS SupunS added the Feature label Jan 28, 2025
@SupunS SupunS self-assigned this Jan 28, 2025
bbq/compiler/compiler_test.go Show resolved Hide resolved
ast/variable_declaration.go Show resolved Hide resolved
bbq/compiler/desugar.go Show resolved Hide resolved
bbq/compiler/desugar.go Show resolved Hide resolved
@SupunS SupunS marked this pull request as ready for review January 28, 2025 23:13
@SupunS SupunS requested a review from turbolent as a code owner January 28, 2025 23:13
@SupunS SupunS requested a review from jsproz January 28, 2025 23:13
Base automatically changed from supun/generate-code-for-interfaces to feature/compiler January 29, 2025 22:15
Copy link

github-actions bot commented Jan 29, 2025

Cadence Benchstat comparison

This branch with compared with the base branch onflow:feature/compiler commit 17bfacc
The command for i in {1..N}; do go test ./... -run=XXX -bench=. -benchmem -shuffle=on; done was used.
Bench tests were run a total of 7 times on each branch.

Collapsed results for better readability

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Nice!

ast/variable_declaration.go Show resolved Hide resolved
bbq/compiler/compiler_test.go Show resolved Hide resolved
sema/check_function.go Show resolved Hide resolved
@SupunS SupunS merged commit 9de8b2b into feature/compiler Feb 5, 2025
9 checks passed
@SupunS SupunS deleted the supun/compiler-result-variable branch February 5, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants