Skip to content
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

Move value-only methods to InstallableValue #7757

Merged
merged 1 commit into from Mar 24, 2023

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Feb 5, 2023

Motivation

These methods would previously fail on the other Installables, so moving them to this class is more correct as to where they actually work.

Additionally, a InstallableValueCommand is created to make it easier (or rather no worse than before) to write commands that just work on InstallableValues.

Context

Besides being a cleanup to avoid failing default methods, this gets us closer to NixOS/rfcs#134.

Depends on #7750

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or bug fix: updated release notes

@dpulls
Copy link

dpulls bot commented Feb 21, 2023

🎉 All dependencies have been resolved !

virtual std::pair<Value *, PosIdx> toValue(EvalState & state)
{
throw Error("argument '%s' cannot be evaluated", what());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

notes: this is the main motivation, remove default implementation of an error

@Ericson2314 Ericson2314 force-pushed the more-installable-value branch 2 times, most recently from 1ea7208 to a0f6067 Compare March 15, 2023 20:56
@dpulls
Copy link

dpulls bot commented Mar 15, 2023

🎉 All dependencies have been resolved !

@Ericson2314 Ericson2314 marked this pull request as ready for review March 15, 2023 21:43
@Ericson2314 Ericson2314 changed the base branch from master to 0.5-release March 15, 2023 21:43
@Ericson2314 Ericson2314 changed the base branch from 0.5-release to master March 15, 2023 21:43
These methods would previously fail on the other `Installable`s, so
moving them to this class is more correct as to where they actually
work.

Additionally, a `InstallableValueCommand` is created to make it easier
(or rather no worse than before) to write commands that just work on
`InstallableValue`s.

Besides being a cleanup to avoid failing default methods, this gets us
closer to NixOS/rfcs#134.
@Ericson2314 Ericson2314 added the RFC Related to an accepted RFC label Mar 17, 2023
@edolstra edolstra merged commit e00abd3 into NixOS:master Mar 24, 2023
@Ericson2314 Ericson2314 deleted the more-installable-value branch March 24, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Related to an accepted RFC
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants