Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[runtime] Throw exception for condition we don't handle in the dynamic registrar. #20568

Merged
merged 4 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions runtime/trampolines-invoke.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@
}

if (has_nsobject) {
if (strchr (sel_getName (sel), ':') != NULL) {
char *msg = xamarin_strdup_printf ("The dynamic registrar does not support calling base Objective-C constructors with arguments (type: %s, selector: %s). Please use any of the static registrars.", class_getName ([self class]), sel_getName (sel));
exception_gchandle = xamarin_create_product_exception (8058, msg);
xamarin_free (msg);
xamarin_process_managed_exception_gchandle (exception_gchandle);
return;
}
self = xamarin_invoke_objc_method_implementation (self, sel, (IMP) xamarin_ctor_trampoline);
marshal_return_value (context, "|", __SIZEOF_POINTER__, self, NULL, false, NULL, NULL, &exception_gchandle);
xamarin_process_managed_exception_gchandle (exception_gchandle);
Expand Down
9 changes: 9 additions & 0 deletions tools/mtouch/Errors.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions tools/mtouch/Errors.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2271,4 +2271,8 @@
<value>.NET for {0} does not support server garbage collection.</value>
<comment>{0}: the platform (iOS, macOS, etc.)</comment>
</data>

<data name="MX8058" xml:space="preserve">
<value>The dynamic registrar does not support calling base Objective-C constructors with arguments (type: %s, selector: %s). Please use any of the static registrars.</value>
</data>
</root>
Loading