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
|
// Collision - rename
|
||||||
anyChange = true
|
anyChange = true
|
||||||
|
|
||||||
|
rootMethodName := m.OverrideMethodName
|
||||||
|
if rootMethodName == "" {
|
||||||
|
rootMethodName = m.MethodName
|
||||||
|
}
|
||||||
|
|
||||||
ctr := 2
|
ctr := 2
|
||||||
var proposedName string
|
var proposedName string
|
||||||
for {
|
for {
|
||||||
proposedName = fmt.Sprintf("%s%d", m.MethodName, ctr)
|
proposedName = fmt.Sprintf("%s%d", rootMethodName, ctr)
|
||||||
if _, ok := existing[proposedName]; !ok {
|
if _, ok := existing[proposedName]; !ok {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -33,7 +38,7 @@ func astTransformOverloads(parsed *CppParsedHeader) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
existing[proposedName] = struct{}{}
|
existing[proposedName] = struct{}{}
|
||||||
m.OverrideMethodName = m.MethodName
|
m.OverrideMethodName = rootMethodName
|
||||||
m.MethodName = proposedName
|
m.MethodName = proposedName
|
||||||
c.Methods[j] = m
|
c.Methods[j] = m
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user