Preserve the is_final bit when importing an impl declaration (#5461)

We were importing all impls as non-final, since we forgot to set the new
field when constructing the imported Impl. Adds a test that fails before
this PR, since the imported Impl is treated as non-final.
This commit is contained in:
Dana Jansens
2025-05-12 18:10:36 +00:00
committed by GitHub
parent d5db325d19
commit 010efd2e40
3 changed files with 36 additions and 2 deletions
+2 -1
View File
@@ -2126,7 +2126,8 @@ static auto MakeImplDeclaration(ImportContext& context,
{.self_id = SemIR::TypeInstId::None,
.constraint_id = SemIR::TypeInstId::None,
.interface = SemIR::SpecificInterface::None,
.witness_id = witness_id}});
.witness_id = witness_id,
.is_final = import_impl.is_final}});
// Write the impl ID into the ImplDecl.
auto impl_const_id =