diff options
author | Shea Levy <shea@shealevy.com> | 2014-03-09T18·41-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-03-10T09·14+0100 |
commit | 049a379ec6ca755bcc077fd0e8da186ff76b8679 (patch) | |
tree | 66552a4997d66ce61d87f822d96b8786fe0c62e4 /src/libexpr/eval.cc | |
parent | 908e9ce259710037ae9824a3246143e46e27e867 (diff) |
The expr of AttrNames/DynamicAttrDefs is always an ExprConcatStrings
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r-- | src/libexpr/eval.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 730b431cf255..04c3418a0d45 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -642,15 +642,13 @@ void ExprAttrs::eval(EvalState & state, Env & env, Value & v) /* dynamic attrs apply *after* rec and __overrides */ foreach (DynamicAttrDefs::iterator, i, dynamicAttrs) { Value nameVal; - assert(dynamic_cast<ExprConcatStrings *>(i->nameExpr)); - ExprConcatStrings * nameExpr = static_cast<ExprConcatStrings *>(i->nameExpr); - if (nameExpr->es->size() == 1) { - nameExpr->es->front()->eval(state, *dynamicEnv, nameVal); + if (i->nameExpr->es->size() == 1) { + i->nameExpr->es->front()->eval(state, *dynamicEnv, nameVal); state.forceValue(nameVal); if (nameVal.type == tNull) continue; } - nameExpr->eval(state, *dynamicEnv, nameVal); + i->nameExpr->eval(state, *dynamicEnv, nameVal); state.forceStringNoCtx(nameVal); Symbol nameSym = state.symbols.create(nameVal.string.s); Bindings::iterator j = v.attrs->find(nameSym); |