summaryrefslogtreecommitdiffstats
path: root/src/libexpr/primops/fetchTree.cc
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/primops/fetchTree.cc
parent9f056f7afdb85b8c3bd59638197e356f269129b2 (diff)
Use Value::normalType on all forced values instead of Value::type
Diffstat (limited to 'src/libexpr/primops/fetchTree.cc')
-rw-r--r--src/libexpr/primops/fetchTree.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc
index d094edf92..6d93e1dc2 100644
--- a/src/libexpr/primops/fetchTree.cc
+++ b/src/libexpr/primops/fetchTree.cc
@@ -85,25 +85,25 @@ static void fetchTree(
state.forceValue(*args[0]);
- if (args[0]->type == tAttrs) {
+ if (args[0]->normalType() == nAttrs) {
state.forceAttrs(*args[0], pos);
fetchers::Attrs attrs;
for (auto & attr : *args[0]->attrs) {
state.forceValue(*attr.value);
- if (attr.value->type == tPath || attr.value->type == tString)
+ if (attr.value->normalType() == nPath || attr.value->normalType() == nString)
addURI(
state,
attrs,
attr.name,
state.coerceToString(*attr.pos, *attr.value, context, false, false)
);
- else if (attr.value->type == tString)
+ else if (attr.value->normalType() == nString)
addURI(state, attrs, attr.name, attr.value->string.s);
- else if (attr.value->type == tBool)
+ else if (attr.value->normalType() == nBool)
attrs.emplace(attr.name, Explicit<bool>{attr.value->boolean});
- else if (attr.value->type == tInt)
+ else if (attr.value->normalType() == nInt)
attrs.emplace(attr.name, attr.value->integer);
else
throw TypeError("fetchTree argument '%s' is %s while a string, Boolean or integer is expected",
@@ -163,7 +163,7 @@ static void fetch(EvalState & state, const Pos & pos, Value * * args, Value & v,
state.forceValue(*args[0]);
- if (args[0]->type == tAttrs) {
+ if (args[0]->normalType() == nAttrs) {
state.forceAttrs(*args[0], pos);