See mono/tests/generic-type-load-exception.2.il
FIXME we should better report this error to the caller
*/
- if (!klass->methods || klass->exception_type) {
+ if (!klass->methods || mono_class_has_failure (klass)) {
mono_error_set_type_load_class (error, klass, "Could not find method due to a type load error"); //FIXME get the error from the class
return NULL;
int i;
mono_class_setup_methods (klass);
- g_assert (!klass->exception_type); /*FIXME this should not fail, right?*/
+ g_assert (!mono_class_has_failure (klass)); /*FIXME this should not fail, right?*/
for (i = 0; i < klass->method.count; ++i) {
MonoMethod *method = klass->methods [i];
if (strcmp (method->name, name) == 0 && sig->param_count == method->signature->param_count)
MonoMethod *
mono_get_method (MonoImage *image, guint32 token, MonoClass *klass)
{
- return mono_get_method_full (image, token, klass, NULL);
+ MonoError error;
+ MonoMethod *result = mono_get_method_checked (image, token, klass, NULL, &error);
+ mono_error_cleanup (&error);
+ return result;
}
MonoMethod *
{
MonoError error;
MonoMethod *result = mono_get_method_checked (image, token, klass, context, &error);
- mono_loader_assert_no_error ();
- if (!mono_error_ok (&error)) {
- mono_loader_set_error_from_mono_error (&error);
- mono_error_cleanup (&error);
- }
+ mono_error_cleanup (&error);
return result;
}
{
MonoError error;
MonoMethod *result = mono_get_method_constrained_checked (image, token, constrained_class, context, cil_method, &error);
-
- mono_loader_assert_no_error ();
- if (!mono_error_ok (&error)) {
- mono_loader_set_error_from_mono_error (&error);
- mono_error_cleanup (&error);
- }
+ mono_error_cleanup (&error);
return result;
}
return mono_metadata_token_index (method->token);
mono_class_setup_methods (klass);
- if (klass->exception_type)
+ if (mono_class_has_failure (klass))
return 0;
for (i = 0; i < klass->method.count; ++i) {
if (method == klass->methods [i]) {