use std::string

This commit is contained in:
Max Headroom 2022-03-05 01:42:54 +01:00
parent 2ba1c12598
commit 5335ad6c35

View file

@ -788,17 +788,17 @@ Bindings * SourceExprCommand::getOverrideArgs(EvalState & state, ref<Store> stor
Value * v = state.allocValue(); Value * v = state.allocValue();
if (i.second[0] == 'E') { if (i.second[0] == 'E') {
// is a raw expression, parse // is a raw expression, parse
state.mkThunk_(*v, state.parseExprFromString(string(i.second, 1), absPath("."))); state.mkThunk_(*v, state.parseExprFromString(std::string(i.second, 1), absPath(".")));
} else if (i.second[0] == 'F') { } else if (i.second[0] == 'F') {
// is a flakeref // is a flakeref
auto [vNew, pos] = parseInstallable(store, string(i.second, 1), false, false)->toValue(state); auto [vNew, pos] = parseInstallable(store, std::string(i.second, 1), false, false)->toValue(state);
v = vNew; v = vNew;
} else if (i.second[0] == 'X') { } else if (i.second[0] == 'X') {
// is not a flakeref, use attrPath from file // is not a flakeref, use attrPath from file
// error because --override covers expressions already // error because --override covers expressions already
if (!file) if (!file)
throw Error("no file to reference override from"); throw Error("no file to reference override from");
auto [vNew, pos] = parseInstallable(store, string(i.second, 1), false, true)->toValue(state); auto [vNew, pos] = parseInstallable(store, std::string(i.second, 1), false, true)->toValue(state);
v = vNew; v = vNew;
} else { } else {
throw Error("[BUG] unknown argtype %s",i.second[0]); throw Error("[BUG] unknown argtype %s",i.second[0]);