mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Do not try to recover from using impl outside class error (#4755)
This prevents crashing when the wrongly used `impl` uses a poisoned name. #4622
This commit is contained in:
@@ -102,6 +102,7 @@ auto HandleParseNode(Context& context, Parse::DefaultSelfImplAsId node_id)
|
||||
"`impl as` can only be used in a class");
|
||||
context.emitter().Emit(node_id, ImplAsOutsideClass);
|
||||
self_type_id = SemIR::ErrorInst::SingletonTypeId;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Build the implicit access to the enclosing `Self`.
|
||||
|
||||
Reference in New Issue
Block a user