[vala] Report error on incorrect use of [ModuleInit]



commit 5fd7b8cebb983fccdebcd9329671d94c1e5cf826
Author: Jürg Billeter <j bitron ch>
Date:   Wed Apr 28 17:03:04 2010 +0200

    Report error on incorrect use of [ModuleInit]
    
    Fixes bug 616805.

 codegen/valaccodebasemodule.vala |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 6fdc6fd..dc558c7 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -352,6 +352,9 @@ public class Vala.CCodeBaseModule : CCodeModule {
 						break;
 					}
 				}
+				if (!in_plugin) {
+					Report.error (context.module_init_method.source_reference, "[ModuleInit] requires a parameter of type `GLib.TypeModule'");
+				}
 			}
 
 			var dbus_ns = root_symbol.scope.lookup ("DBus");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]