-
Notifications
You must be signed in to change notification settings - Fork 231
Refactor some solver stuff #1836
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
Conversation
This makes it statically clearer which type of assignment is happening where.
Before, we considered an assignment to be a decision if it was positive and the package name was a PackageId.
This gives us a central place to track which decisions have been made, rather than needing to derive that information from the assignment list.
Now that we're tracking decisions in PartialSolution, we no longer need to distinguish decision-like terms from derivation-like terms.
lib/src/package_name.dart
Outdated
!constraint.isAny || (source is! PathSource && source is! GitSource)) { | ||
!isRoot && | ||
(!constraint.isAny || | ||
(source is! PathSource && source is! GitSource))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Operators nested four deep is pretty rough. Maybe break some of this out into local variables so it's clearer what they represent?
Or perhaps add a getter on Source that means what (source is! PathSource && source is! GitSource)
means? Is it "has multiple versions"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do have Source.hasMultipleVersions
, but I don't think it's exactly the right fit here—we usually expect users to include version constraints for SDK dependencies, even though they technically only have one version available at a time.
I've factored this out into a getter to reduce nesting.
No description provided.