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

Zzq/function contracts/cross package #2

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 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion accumulation/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func run(pass *analysis.Pass) (result interface{}, _ error) {
// Incorporate assertions from this package one-by-one into the inferredAnnotationMap, possibly
// determining local and upstream sites in the process. This is guaranteed not to determine any
// sites unless we really have a reason they have to be determined.
engine.ObservePackage(assertionsResult.FullTriggers)
engine.ObservePackage(assertionsResult.FullTriggers, assertionsResult.Implications)
inferredMap, diagnostics = engine.InferredMapWithDiagnostics()

case inference.NoInfer:
Expand Down
6 changes: 5 additions & 1 deletion assertion/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"go.uber.org/nilaway/assertion/function"
"go.uber.org/nilaway/assertion/global"
"go.uber.org/nilaway/config"
"go.uber.org/nilaway/inference"
"golang.org/x/tools/go/analysis"
)

Expand All @@ -41,6 +42,9 @@ type Result struct {
// part of the result of this sub-analyzer so that the upper-level analyzers can decide what
// to do with them.
Errors []error
// Implications is the extra implications generated from the function contracts analysis, to be
// used in the inference stage.
Implications []*inference.Implication
}

// Analyzer here is the analyzer than generates assertions and passes them onto the accumulator to
Expand Down Expand Up @@ -90,5 +94,5 @@ func run(pass *analysis.Pass) (result interface{}, _ error) {
errs = append(errs, resultErrs...)
}

return Result{FullTriggers: triggers, Errors: errs}, nil
return Result{FullTriggers: triggers, Errors: errs, Implications: r1.Implications}, nil
}
Loading
0