about summary refs log tree commit diff
path: root/src/libexpr/eval-inline.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-04T17·11+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-04T17·11+0200
commit27b44b8cf7072b09a1929ee44ba784b1c8d5211a (patch)
tree7f9324d3422db4f3c2120f9009acc6228a839c40 /src/libexpr/eval-inline.hh
parent96b695ccab4a4c8c4ef7f14ac261df43dcc00743 (diff)
forceAttrs: Show position info
Diffstat (limited to 'src/libexpr/eval-inline.hh')
-rw-r--r--src/libexpr/eval-inline.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libexpr/eval-inline.hh b/src/libexpr/eval-inline.hh
index c34e24d3da39..c275f7ba83e8 100644
--- a/src/libexpr/eval-inline.hh
+++ b/src/libexpr/eval-inline.hh
@@ -55,6 +55,14 @@ inline void EvalState::forceAttrs(Value & v)
 }
 
 
+inline void EvalState::forceAttrs(Value & v, const Pos & pos)
+{
+    forceValue(v);
+    if (v.type != tAttrs)
+        throwTypeError("value is %1% while a set was expected, at %2%", v, pos);
+}
+
+
 inline void EvalState::forceList(Value & v)
 {
     forceValue(v);