Fix `if`...`if`...`else` ambiguity

This can be parsed two ways. Add a pair of braces so it must be parsed
the intended way.
This commit is contained in:
John Ericson 2024-01-22 10:32:25 -05:00
parent 176dcd5c61
commit 316e50cc7c
1 changed files with 2 additions and 1 deletions

View File

@ -174,11 +174,12 @@ static void fetchTree(
if (!evalSettings.pureEval && !input.isDirect() && experimentalFeatureSettings.isEnabled(Xp::Flakes))
input = lookupInRegistries(state.store, input).first;
if (evalSettings.pureEval && !input.isLocked())
if (evalSettings.pureEval && !input.isLocked()) {
if (params.isFetchGit)
state.debugThrowLastTrace(EvalError("in pure evaluation mode, 'fetchGit' requires a locked input, at %s", state.positions[pos]));
else
state.debugThrowLastTrace(EvalError("in pure evaluation mode, 'fetchTree' requires a locked input, at %s", state.positions[pos]));
}
state.checkURI(input.toURLString());