From 0d44b5e973a47f93a18b1667fdef931b22b5c49e Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Sun, 30 Jan 2011 23:28:02 -0600 Subject: [PATCH] Throw a more helpful exception for missing GetType. * generator/InterfaceGen.cs: if we don't have a GetType method, it's a fatal situation. Throw an exception that identifies the iface in question. --- generator/InterfaceGen.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generator/InterfaceGen.cs b/generator/InterfaceGen.cs index 759485a6e..a107c0b52 100644 --- a/generator/InterfaceGen.cs +++ b/generator/InterfaceGen.cs @@ -159,6 +159,8 @@ namespace GtkSharp.Generation { void GenerateGType (StreamWriter sw) { Method m = GetMethod ("GetType"); + if (m == null) + throw new Exception ("Interface " + QualifiedName + " missing GetType method."); m.GenerateImport (sw); sw.WriteLine ("\t\tprivate static GLib.GType _gtype = new GLib.GType ({0} ());", m.CName); sw.WriteLine ();