diff --git a/src/Mono.Android/Test/Java.Interop/JnienvTest.cs b/src/Mono.Android/Test/Java.Interop/JnienvTest.cs index 75bdedac0e5..11ac6e04b18 100644 --- a/src/Mono.Android/Test/Java.Interop/JnienvTest.cs +++ b/src/Mono.Android/Test/Java.Interop/JnienvTest.cs @@ -85,15 +85,23 @@ public void InvokingNullInstanceDoesNotCrashDalvik () } [Test] - public void NewGenericTypeThrows () + public void NewOpenGenericTypeThrows () { try { var lrefInstance = JNIEnv.StartCreateInstance (typeof (GenericHolder<>), "()V"); JNIEnv.FinishCreateInstance (lrefInstance, "()V"); + Assert.Fail ("SHOULD NOT BE REACHED: creation of open generic types is not supported"); } catch (NotSupportedException) { } } + [Test] + public void NewClosedGenericTypeWorks () + { + using (var holder = new GenericHolder()) { + } + } + [Test] public void NewObjectArrayWithNullArray () { diff --git a/src/monodroid/jni/embedded-assemblies.cc b/src/monodroid/jni/embedded-assemblies.cc index 018289db9cd..f50277f24f9 100644 --- a/src/monodroid/jni/embedded-assemblies.cc +++ b/src/monodroid/jni/embedded-assemblies.cc @@ -345,7 +345,7 @@ EmbeddedAssemblies::typemap_managed_to_java ([[maybe_unused]] MonoType *type, Mo { constexpr char error_message[] = "typemap: unable to find mapping to a Java type from managed type '%s'"; - simple_pointer_guard type_name (mono_type_get_name_full (type, MONO_TYPE_NAME_FORMAT_REFLECTION)); + simple_pointer_guard type_name (mono_type_get_name_full (type, MONO_TYPE_NAME_FORMAT_FULL_NAME)); MonoImage *image = mono_class_get_image (klass); const char *image_name = mono_image_get_name (image); size_t type_name_len = strlen (type_name.get ()); @@ -490,7 +490,7 @@ EmbeddedAssemblies::typemap_managed_to_java (MonoReflectionType *reflection_type return nullptr; } - const char *ret = typemap_managed_to_java (type, mono_type_get_class (type), mvid); + const char *ret = typemap_managed_to_java (type, mono_class_from_mono_type (type), mvid); if (XA_UNLIKELY (utils.should_log (LOG_TIMING))) { total_time.mark_end ();