Skip to content

Commit

Permalink
Fix static method generation in built-in structs (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
tishin authored Jan 4, 2024
1 parent 2cfe340 commit d6a02db
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Generator/Generator/BuiltinGen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,15 @@ func generateBuiltinMethods (_ p: Printer,
p ("@discardableResult /* 1: \(m.name) */ ")
}

p ("public\(isStruct ? "" : " final") func \(escapeSwift (snakeToCamel(m.name))) (\(args))\(retSig)") {
let keyword: String
if m.isStatic {
keyword = " static"
} else if !isStruct {
keyword = " final"
} else {
keyword = ""
}
p ("public\(keyword) func \(escapeSwift (snakeToCamel(m.name))) (\(args))\(retSig)") {

generateMethodCall (p, typeName: typeName, methodToCall: ptrName, godotReturnType: m.returnType, isStatic: m.isStatic, arguments: m.arguments, kind: .methodCall)
}
Expand Down

0 comments on commit d6a02db

Please sign in to comment.