Skip to content

Commit 3c46da4

Browse files
committed
fix: add static keyword to non bind methods for dotnet
1 parent e649bb2 commit 3c46da4

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

pkg/generator/dotnet.go

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -607,10 +607,10 @@ func (g *DotnetGenerator) generateUnmarshaling(method *manifest.Method, indent s
607607
if g.typeMapper.isObjectReturn(method.RetType.Type) {
608608
converter := g.typeMapper.getDataConverter(method.RetType.Type)
609609
if converter != "" {
610-
// Use NativeMethodsT for enum parameters
611-
if method.RetType.Enum != nil {
612-
converter = strings.Replace(converter, "NativeMethods.", "NativeMethodsT.", 1)
613-
}
610+
// Use NativeMethodsT for enum parameters
611+
if method.RetType.Enum != nil {
612+
converter = strings.Replace(converter, "NativeMethods.", "NativeMethodsT.", 1)
613+
}
614614

615615
if strings.Contains(converter, "VectorData") {
616616
sizeFunc := g.typeMapper.getSizeFunction(method.RetType.Type)
@@ -638,10 +638,10 @@ func (g *DotnetGenerator) generateUnmarshaling(method *manifest.Method, indent s
638638

639639
paramName := g.SanitizeName(param.Name)
640640

641-
// Use NativeMethodsT for enum parameters
642-
if param.Enum != nil {
643-
converter = strings.Replace(converter, "NativeMethods.", "NativeMethodsT.", 1)
644-
}
641+
// Use NativeMethodsT for enum parameters
642+
if param.Enum != nil {
643+
converter = strings.Replace(converter, "NativeMethods.", "NativeMethodsT.", 1)
644+
}
645645

646646
if strings.Contains(converter, "VectorData") {
647647
sizeFunc := g.typeMapper.getSizeFunction(param.Type)
@@ -1024,7 +1024,12 @@ func (g *DotnetGenerator) generateClassBinding(m *manifest.Manifest, class *mani
10241024
}
10251025
}
10261026

1027-
sb.WriteString(fmt.Sprintf("\t\tpublic %s %s(%s)\n", retType, binding.Name, formattedParams))
1027+
staticKeyword := ""
1028+
if !binding.BindSelf {
1029+
staticKeyword = "static "
1030+
}
1031+
1032+
sb.WriteString(fmt.Sprintf("\t\tpublic %s%s %s(%s)\n", staticKeyword, retType, binding.Name, formattedParams))
10281033
sb.WriteString("\t\t{\n")
10291034

10301035
// Add validity check for instance methods

0 commit comments

Comments
 (0)