diff --git a/eval/eval/create_list_step.cc b/eval/eval/create_list_step.cc index 38d79e2b0..e96115d6d 100644 --- a/eval/eval/create_list_step.cc +++ b/eval/eval/create_list_step.cc @@ -166,6 +166,13 @@ class CreateListDirectStep : public DirectExpressionStep { } } + if (!unknowns.IsEmpty()) { + // We found an unknown, there is no point in attempting to create a + // list. Instead iterate through the remaining elements and look for + // more unknowns. + continue; + } + // Conditionally add if optional. if (optional_indices_.contains(static_cast(i))) { if (auto optional_arg =