mirror of
https://github.com/mappu/miqt.git
synced 2025-01-03 14:18:37 +00:00
genbindings/transform: fix overloads-of-optionals
This commit is contained in:
parent
aaa1d1274b
commit
89f4024951
@ -21,10 +21,15 @@ func astTransformOverloads(parsed *CppParsedHeader) {
|
||||
// Collision - rename
|
||||
anyChange = true
|
||||
|
||||
rootMethodName := m.OverrideMethodName
|
||||
if rootMethodName == "" {
|
||||
rootMethodName = m.MethodName
|
||||
}
|
||||
|
||||
ctr := 2
|
||||
var proposedName string
|
||||
for {
|
||||
proposedName = fmt.Sprintf("%s%d", m.MethodName, ctr)
|
||||
proposedName = fmt.Sprintf("%s%d", rootMethodName, ctr)
|
||||
if _, ok := existing[proposedName]; !ok {
|
||||
break
|
||||
}
|
||||
@ -33,7 +38,7 @@ func astTransformOverloads(parsed *CppParsedHeader) {
|
||||
}
|
||||
|
||||
existing[proposedName] = struct{}{}
|
||||
m.OverrideMethodName = m.MethodName
|
||||
m.OverrideMethodName = rootMethodName
|
||||
m.MethodName = proposedName
|
||||
c.Methods[j] = m
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user