From ee8499483e0ae520de4f2a6913af59f0f8f7428a Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Sun, 5 Jan 2014 17:28:30 +0100 Subject: [PATCH] generator: Fix signature of static method overloads For method with optional parameters, when generating the overload without the optional parameters, mark the overload as static if the original method is static. --- generator/Method.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generator/Method.cs b/generator/Method.cs index 14f0b65ec..08c0537ce 100644 --- a/generator/Method.cs +++ b/generator/Method.cs @@ -218,7 +218,10 @@ namespace GtkSharp.Generation { public void GenerateOverloads (StreamWriter sw) { sw.WriteLine (); - sw.WriteLine ("\t\tpublic " + retval.CSType + " " + Name + "(" + (Signature != null ? Signature.WithoutOptional () : "") + ") {"); + sw.Write ("\t\tpublic "); + if (IsStatic) + sw.Write ("static "); + sw.WriteLine (retval.CSType + " " + Name + "(" + (Signature != null ? Signature.WithoutOptional () : "") + ") {"); sw.WriteLine ("\t\t\t{0}{1} ({2});", !retval.IsVoid ? "return " : String.Empty, Name, Signature.CallWithoutOptionals ()); sw.WriteLine ("\t\t}"); }