On MacOS with Swift 5.6 and given the mangling rules from here with the following Swift code:
class Car //AB
{
class Foo //AD
{
func Foo() -> Void //AD
{
}
}
}
The resulting mangled name for Foo is _$s4TEST3CarC3FooCADyyF (Target name TEST), I cannot understand why Foo is given the index code AD, I would expect AC to be assigned:
AA AB AC
TEST.Car.Foo.Foo
In this other example:
class TEST //AA
{
class Car //AC
{
class Foo //AE
{
class Car //AC
{
func Foo() -> Void //AE
{
}
}
}
}
}
The mangled name is _$s4TESTAAC3CarC3FooCACCAEyyF, again those are the values I would assign:
AA AB AC
TEST.TEST.Car.Foo.Car.Foo
Why Foo is assigned to AE after the first long form encoding 3Foo? Why AB and AD are skipped and not used? Note that this is only in regards to recurrent items in the string, if the are no recurrent items i can encode all happily.