mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
Allow open switch-enum in 5 places
This commit is contained in:
parent
3dac4c7874
commit
9470ee877d
4 changed files with 21 additions and 0 deletions
|
@ -125,6 +125,9 @@ static FlakeInput parseFlakeInput(EvalState & state,
|
|||
follows.insert(follows.begin(), lockRootPath.begin(), lockRootPath.end());
|
||||
input.follows = follows;
|
||||
} else {
|
||||
// Allow selecting a subset of enum values
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wswitch-enum"
|
||||
switch (attr.value->type()) {
|
||||
case nString:
|
||||
attrs.emplace(state.symbols[attr.name], attr.value->string.s);
|
||||
|
@ -139,6 +142,7 @@ static FlakeInput parseFlakeInput(EvalState & state,
|
|||
throw TypeError("flake input attribute '%s' is %s while a string, Boolean, or integer is expected",
|
||||
state.symbols[attr.name], showType(*attr.value));
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
} catch (Error & e) {
|
||||
e.addTrace(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue