Zzq/function contracts/general nonnil#8
Conversation
There was a problem hiding this comment.
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
| // 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 { |
There was a problem hiding this comment.
style: Typo in comment: 'singe comment group' should be 'single comment group'.
| // 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 { |
No description provided.