diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-04-04T17·11+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-04-04T17·11+0200 |
commit | 27b44b8cf7072b09a1929ee44ba784b1c8d5211a (patch) | |
tree | 7f9324d3422db4f3c2120f9009acc6228a839c40 /src/libexpr/eval-inline.hh | |
parent | 96b695ccab4a4c8c4ef7f14ac261df43dcc00743 (diff) |
forceAttrs: Show position info
Diffstat (limited to 'src/libexpr/eval-inline.hh')
-rw-r--r-- | src/libexpr/eval-inline.hh | 8 |
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); |