[Mono-list] Embedded API: Method signature not found with generic parameter

mugginsoft jonathan at mugginsoft.com
Thu Jul 11 14:58:26 UTC 2013


Robert Jordan wrote
> Try mono_class_get_method_from_name ("ToList", 1) or create
> a descriptor from ":ToList(System.Collections.Generic.IEnumerable`1)".

Thanks.
mono_class_get_method_from_name ("ToList", 1) does resolve.

However:
My actual implementation is via Dumbarton which uses
mono_method_desc_search_in_class.
This is still failing:

    // mono_class_get_method_from_name takes a simple method name
    const char *methodName = "ToList";
    MonoMethod *method = mono_class_get_method_from_name(monoClass,
methodName, 1);
    if (!method) {
        abort();    // passes
    }
    
    // get the method by descriptor
    method = NULL;
    methodName = ":ToList(System.Collections.Generic.IEnumerable`1)";
    MonoMethodDesc *methodDesc = mono_method_desc_new(methodName, YES);
    while (monoClass != NULL) {
        method = mono_method_desc_search_in_class(methodDesc, monoClass);
        if (method != NULL) {
            break;
        }
        monoClass = mono_class_get_parent(monoClass);
    }

    if (!method) {
        abort();    // fails
    }

Jonathan



--
View this message in context: http://mono.1490590.n4.nabble.com/Embedded-API-Method-signature-not-found-with-generic-parameter-tp4660157p4660165.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list