Skip to content

Instantly share code, notes, and snippets.

@spouliot
Created August 17, 2011 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spouliot/1151513 to your computer and use it in GitHub Desktop.
Save spouliot/1151513 to your computer and use it in GitHub Desktop.
diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c
index 00aaf45..1bdcc5c 100644
--- a/mono/mini/aot-compiler.c
+++ b/mono/mini/aot-compiler.c
@@ -2735,7 +2735,12 @@ add_wrappers (MonoAotCompile *acfg)
MonoType *t;
MonoClass *klass;
- g_assert (method->flags & METHOD_ATTRIBUTE_STATIC);
+ /* this cannot be enforced by the C# compiler so we must give the user some warning before aborting */
+ if (!(method->flags & METHOD_ATTRIBUTE_STATIC)) {
+ g_warning ("AOT restriction: Method '%s' must be static since it is decorated with [MonoPInvokeCallback]. See http://ios.xamarin.com/Documentation/Limitations#Reverse_Callbacks",
+ mono_method_full_name (method, TRUE));
+ exit (1);
+ }
g_assert (sig->param_count == 1);
g_assert (sig->params [0]->type == MONO_TYPE_CLASS && !strcmp (mono_class_from_mono_type (sig->params [0])->name, "Type"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment