diff options
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/eval.cc | 2 | ||||
-rw-r--r-- | src/libexpr/primops/fetchTree.cc | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 852e8aa11..6fcb2917c 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -158,7 +158,7 @@ string showType(ValueType type) { switch (type) { case tInt: return "an integer"; - case tBool: return "a boolean"; + case tBool: return "a Boolean"; case tString: return "a string"; case tPath: return "a path"; case tNull: return "null"; diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc index a9becddd9..2b3f1b76d 100644 --- a/src/libexpr/primops/fetchTree.cc +++ b/src/libexpr/primops/fetchTree.cc @@ -58,8 +58,10 @@ static void prim_fetchTree(EvalState & state, const Pos & pos, Value * * args, V state.forceValue(*attr.value); if (attr.value->type == tString) attrs.emplace(attr.name, attr.value->string.s); + else if (attr.value->type == tBool) + attrs.emplace(attr.name, attr.value->boolean); else - throw TypeError("fetchTree argument '%s' is %s while a string is expected", + throw TypeError("fetchTree argument '%s' is %s while a string or Boolean is expected", attr.name, showType(*attr.value)); } |