IDLGenerators: Cast wrapped references to a known reference type

They may be GC::Ref<T> objects, which should be converted to T const&
before being so nicely const-cast to T&.
This commit is contained in:
Ali Mohammad Pur 2025-04-22 11:16:19 +02:00 committed by Andrew Kaster
commit f341bb0522
Notes: github-actions[bot] 2025-04-22 14:44:58 +00:00

View file

@ -2074,7 +2074,7 @@ static void generate_wrap_statement(SourceGenerator& generator, ByteString const
)~~~");
} else {
scoped_generator.append(R"~~~(
@result_expression@ &const_cast<@type@&>(@value@);
@result_expression@ &const_cast<@type@&>(static_cast<@type@ const&>(@value@));
)~~~");
}
}