mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-22 12:12:42 +00: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:
1 parent
fa9d838270
commit
72e594dfd0
3 files changed
+149
-46
No files matched your search
@@ -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