This repository was archived by the owner on Jan 28, 2025. It is now read-only.
fix: solution.Error() returns untyped nil when SAT#140
Merged
joelanford merged 1 commit intooperator-framework:mainfrom Aug 15, 2023
Merged
fix: solution.Error() returns untyped nil when SAT#140joelanford merged 1 commit intooperator-framework:mainfrom
joelanford merged 1 commit intooperator-framework:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #140 +/- ##
==========================================
+ Coverage 61.90% 62.03% +0.13%
==========================================
Files 16 16
Lines 567 569 +2
==========================================
+ Hits 351 353 +2
Misses 198 198
Partials 18 18
|
m1kola
reviewed
Aug 14, 2023
Comment on lines
+27
to
+29
| if s.err == nil { | ||
| return nil | ||
| } |
Member
There was a problem hiding this comment.
I think we should just use error interface for s.err instead a specific type. This way we avoid having this strange if and still can avoid nil not being nil issue.
diff --git a/pkg/deppy/solver/solver.go b/pkg/deppy/solver/solver.go
index d60036f..f8758f5 100644
--- a/pkg/deppy/solver/solver.go
+++ b/pkg/deppy/solver/solver.go
@@ -16,7 +16,7 @@ import (
// A successful execution of the solver can still end in an error when no solution can
// be found.
type Solution struct {
- err deppy.NotSatisfiable
+ err error
selection map[deppy.Identifier]deppy.Variable
variables []deppy.Variable
}
Member
Author
There was a problem hiding this comment.
Done! Wasn't sure if that change would have knock-on effects. Looks like it compiles and tests pass though, so I assume all good.
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
1b37541 to
f58565c
Compare
m1kola
approved these changes
Aug 15, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #139