Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

2008-05-20 Mark Probst <mark.probst@gmail.com>

	* generic-null-call.2.cs: Tests non-virtual callvirt on generic
	methods with this==null.

	* Makefile.am: Test added.

svn path=/trunk/mono/; revision=103566
  • Loading branch information...
commit ebd46877fda8e0b69915212f6902b6ac5b558977 1 parent 5d56461
@schani schani authored
View
7 mono/tests/ChangeLog
@@ -1,3 +1,10 @@
+2008-05-20 Mark Probst <mark.probst@gmail.com>
+
+ * generic-null-call.2.cs: Tests non-virtual callvirt on generic
+ methods with this==null.
+
+ * Makefile.am: Test added.
+
2008-05-16 Rodrigo Kumpera <rkumpera@novell.com>
* bug-389886.2.il: Regression test for bug #389886.
View
5 mono/tests/Makefile.am
@@ -270,6 +270,7 @@ BASE_TEST_CS_SRC= \
generic-virtual.2.cs \
generic-interface-methods.2.cs \
generic-array-type.2.cs \
+ generic-null-call.2.cs \
recursive-generics.2.cs \
bug-80392.2.cs \
dynamic-method-access.2.cs \
@@ -693,7 +694,8 @@ test-generic-sharing : generics-sharing.2.exe shared-generic-methods.2.exe \
generic-ldtoken.2.exe \
generic-ldtoken-method.2.exe generic-ldtoken-field.2.exe \
generic-virtual.2.exe generic-tailcall.2.exe \
- generic-interface-methods.2.exe generic-array-type.2.exe
+ generic-interface-methods.2.exe generic-array-type.2.exe \
+ generic-null-call.2.exe
$(RUNTIME) -O=gshared,-inline generics-sharing.2.exe
$(RUNTIME) -O=gshared,-inline shared-generic-methods.2.exe
$(RUNTIME) -O=gshared,-inline shared-generic-synchronized.2.exe
@@ -712,6 +714,7 @@ test-generic-sharing : generics-sharing.2.exe shared-generic-methods.2.exe \
$(RUNTIME) -O=gshared,-inline generic-tailcall.2.exe
$(RUNTIME) -O=gshared,-inline generic-interface-methods.2.exe
$(RUNTIME) -O=gshared,-inline generic-array-type.2.exe
+ $(RUNTIME) -O=gshared,-inline generic-null-call.2.exe
EXTRA_DIST += async-exceptions.cs
async-exceptions.exe : async-exceptions.cs
View
32 mono/tests/generic-null-call.2.cs
@@ -0,0 +1,32 @@
+using System;
+
+public struct GenStruct<T> {
+ public int a;
+ public T b;
+}
+
+public class Gen<T> {
+ public virtual S[] newArr<S> (int i) {
+ return new S [i];
+ }
+}
+
+public class GenSub<T> : Gen<T> {
+ public sealed override S[] newArr<S> (int i) {
+ return new S [i+1];
+ }
+}
+
+public class main {
+ public static int Main () {
+ GenSub<string> gst = null;
+
+ try {
+ gst.newArr<object> (3);
+ } catch (NullReferenceException) {
+ return 0;
+ }
+
+ return 1;
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.