- GString *err = g_string_new ("@!#$<InvalidType>$#!@");
- if (container)
- t = mono_metadata_parse_type_full (m, NULL, 0, start, &ptr);
- if (t) {
- char *name = dis_stringify_type (m, t, is_def);
- g_warning ("Encountered a generic type inappropriate for its context");
- g_string_append (err, " // ");
- g_string_append (err, name);
- g_free (name);
- } else {
- g_warning ("Encountered an invalid type");
- }
- *result = g_string_free (err, FALSE);
+ *result = g_strdup_printf ("Invalid type due to %s", mono_error_get_message (&error));
+ mono_error_cleanup (&error);