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 authored and GitHub committed 2024-10-31 18:27:43 +00:00
1 parent 57c9a2ed4a
commit 99e96605bf
3 files changed
+12 -22

No files matched your search

@@ -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