aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/flake
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-12-12 02:09:10 +0100
committerSilvan Mosberger <contact@infinisil.com>2020-12-12 03:31:48 +0100
commit22ead43a0b8f94f5a4fb64cff14bf6a2a35d671c (patch)
treed2262f82e8e1032fa285a2ad6ad87f876feb93f7 /src/libexpr/flake
parent9f056f7afdb85b8c3bd59638197e356f269129b2 (diff)
Use Value::normalType on all forced values instead of Value::type
Diffstat (limited to 'src/libexpr/flake')
-rw-r--r--src/libexpr/flake/flake.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc
index 881b1b4e5..c126b2c40 100644
--- a/src/libexpr/flake/flake.cc
+++ b/src/libexpr/flake/flake.cc
@@ -120,7 +120,7 @@ static FlakeInput parseFlakeInput(EvalState & state,
expectType(state, nString, *attr.value, *attr.pos);
input.follows = parseInputPath(attr.value->string.s);
} else {
- if (attr.value->type == tString)
+ if (attr.value->normalType() == nString)
attrs.emplace(attr.name, attr.value->string.s);
else
throw TypeError("flake input attribute '%s' is %s while a string is expected",
@@ -235,17 +235,17 @@ static Flake getFlake(
for (auto & setting : *nixConfig->value->attrs) {
forceTrivialValue(state, *setting.value, *setting.pos);
- if (setting.value->type == tString)
+ if (setting.value->normalType() == nString)
flake.config.settings.insert({setting.name, state.forceStringNoCtx(*setting.value, *setting.pos)});
- else if (setting.value->type == tInt)
+ else if (setting.value->normalType() == nInt)
flake.config.settings.insert({setting.name, state.forceInt(*setting.value, *setting.pos)});
- else if (setting.value->type == tBool)
+ else if (setting.value->normalType() == nBool)
flake.config.settings.insert({setting.name, state.forceBool(*setting.value, *setting.pos)});
- else if (setting.value->isList()) {
+ else if (setting.value->normalType() == nList) {
std::vector<std::string> ss;
for (unsigned int n = 0; n < setting.value->listSize(); ++n) {
auto elem = setting.value->listElems()[n];
- if (elem->type != tString)
+ if (elem->normalType() != nString)
throw TypeError("list element in flake configuration setting '%s' is %s while a string is expected",
setting.name, showType(*setting.value));
ss.push_back(state.forceStringNoCtx(*elem, *setting.pos));