Don't create a compile time binding after CompileTimeBindingInVarDecl (#4463)

Related to #4461, more generally try not to produce a compile-time
binding when the code shouldn't be able to do so.
This commit is contained in:
Jon Ross-Perkins
2024-10-31 18:27:43 +00:00
committed by GitHub
parent 57c9a2ed4a
commit 99e96605bf
3 changed files with 12 additions and 22 deletions
@@ -93,6 +93,8 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
CompileTimeBindingInVarDecl, Error,
"`var` declaration cannot declare a compile-time binding");
context.emitter().Emit(type_node, CompileTimeBindingInVarDecl);
// Prevent lambda helpers from creating a compile time binding.
needs_compile_time_binding = false;
}
auto binding_id =
is_generic