mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-29 19:24:59 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user