mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Fix formatting for imported impls. (#4194)
`impl`s may be defined even if they have no scope if they were imported.
This commit is contained in:
@@ -233,7 +233,7 @@ class FormatterImpl {
|
||||
|
||||
llvm::SaveAndRestore impl_scope(scope_, inst_namer_->GetScopeFor(id));
|
||||
|
||||
if (impl_info.scope_id.is_valid()) {
|
||||
if (impl_info.is_defined()) {
|
||||
out_ << ' ';
|
||||
OpenBrace();
|
||||
FormatCodeBlock(impl_info.body_block_id);
|
||||
@@ -242,7 +242,9 @@ class FormatterImpl {
|
||||
// always list the witness in this section.
|
||||
IndentLabel();
|
||||
out_ << "!members:\n";
|
||||
FormatNameScope(impl_info.scope_id);
|
||||
if (impl_info.scope_id.is_valid()) {
|
||||
FormatNameScope(impl_info.scope_id);
|
||||
}
|
||||
|
||||
Indent();
|
||||
out_ << "witness = ";
|
||||
|
||||
Reference in New Issue
Block a user