compiler: don't push overrides for unexported methods

They're internal, no one cares about them externally.
This commit is contained in:
Roman Khimov 2022-11-14 17:11:54 +03:00
parent 92dfec61c9
commit 027e94fbde

View file

@ -287,6 +287,9 @@ func CompileAndSave(src string, o *Options) ([]byte, error) {
cfg := binding.NewConfig() cfg := binding.NewConfig()
cfg.Package = di.MainPkg cfg.Package = di.MainPkg
for _, m := range di.Methods { for _, m := range di.Methods {
if !m.IsExported {
continue
}
for _, p := range m.Parameters { for _, p := range m.Parameters {
if p.RealType.TypeName != "" { if p.RealType.TypeName != "" {
cfg.Overrides[m.Name.Name+"."+p.Name] = p.RealType cfg.Overrides[m.Name.Name+"."+p.Name] = p.RealType