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.
This commit is contained in:
Mike Kestner 2011-01-30 23:28:02 -06:00
parent 955cdcf123
commit 0d44b5e973

View File

@ -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 ();