8000 Zzq/function contracts/general nonnil by lizard-boy · Pull Request #8 · greptileai/nilaway · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Zzq/function contracts/general nonnil #8

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lizard-boy
Copy link
Collaborator

No description provided.

Copy link
@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Overall, this PR refines contract handling by switching from a global check to a per-return scheme, improving granularity when applying contract annotations.

• Refactored /assertion/function/assertiontree/parse_expr_producer.go to use r.RetHasContract(funcObj, i) for per-return checking.
• Updated /assertion/function/analyzer.go to duplicate triggers based on the correct nonnil parameter/return index, improving error clarity.
• Added helper methods (getSingleNonnilToNonnilContract, ParamHasContract, RetHasContract) in /assertion/function/assertiontree/root_assertion_node.go.
• Introduced concurrent contract inference and strict parsing in the functioncontracts package; verify edge cases in branch handling.

💡 (4/5) You can add custom instructions or style guidelines for the bot here!

9 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +38 to +40
// parseContracts parses a slice of function contracts from a singe comment group. If no contract
// is found from the comment group, an empty slice is returned.
func parseContracts(doc *ast.CommentGroup) []*FunctionContract {
Copy link

Choose a reason for hiding this comment

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

style: Typo in comment: 'singe comment group' should be 'single comment group'.

Suggested change
// parseContracts parses a slice of function contracts from a singe comment group. If no contract
// is found from the comment group, an empty slice is returned.
func parseContracts(doc *ast.CommentGroup) []*FunctionContract {
// parseContracts parses a slice of function contracts from a single comment group. If no contract
// is found from the comment group, an empty slice is returned.
func parseContracts(doc *ast.CommentGroup) []*FunctionContract {

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
0