mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:10:12 +01:00
### Description Mangling collisions occur when implementing interfaces with generic parameters. The mangler does not use the specific id, causing the same symbol `_C[FunctionName].[PackageName]:[InterfaceName].[PackageName]` to be generated for all of the implementations below: ```carbon // Generic interface parameters ignored impl C as I(A) impl C as I(B) // Generic class parameters ignored impl D(A) as I impl D(B) as I // Both ignored impl D(A) as I(A) impl D(B) as I(B) ``` ### Changes Updated the mangling logic for `SemIR::ClassDecl` and `SemIR::InterfaceDecl` to include the specific id. Now the mangling ensures unique symbols for generic implementations using the format: `_C[FunctionName].[FunctionSpecificId].[PackageName]:[InterfaceName].[InterfaceSpecificId].[PackageName]`. Closes #6498