Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

2008-06-23 Mark Probst <mark.probst@gmail.com>

	* generic-virtual2.2.cs: Test case for a call from a generic
	method to a method of a generic class where the generic method
	does not require the MRGCTX.

	* Makefile.am: Test added.

svn path=/trunk/mono/; revision=106447
  • Loading branch information...
commit 62f2ae3bc0f144398a6cb901578e63e4706d6799 1 parent eba9c11
@schani schani authored
View
8 mono/tests/ChangeLog
@@ -1,5 +1,13 @@
2008-06-23 Mark Probst <mark.probst@gmail.com>
+ * generic-virtual2.2.cs: Test case for a call from a generic
+ method to a method of a generic class where the generic method
+ does not require the MRGCTX.
+
+ * Makefile.am: Test added.
+
+2008-06-23 Mark Probst <mark.probst@gmail.com>
+
* generic-exceptions.2.cs: Test case for exception handlers in
generic methods with catch clauses depending on the method type
arguments.
View
4 mono/tests/Makefile.am
@@ -275,6 +275,7 @@ BASE_TEST_CS_SRC= \
generic-null-call.2.cs \
generic-special.2.cs \
generic-exceptions.2.cs \
+ generic-virtual2.2.cs \
recursive-generics.2.cs \
bug-80392.2.cs \
dynamic-method-access.2.cs \
@@ -709,7 +710,8 @@ test-generic-sharing : generics-sharing.2.exe shared-generic-methods.2.exe \
generic-method-patching.2.exe generic-static-methods.2.exe \
generic-null-call.2.exe generic-tailcall2.2.exe \
generic-array-exc.2.exe generic-special.2.exe \
- generic-exceptions.2.exe
+ generic-exceptions.2.exe \
+ generic-virtual2.2.exe
for fn in $+ ; do \
echo "Testing $$fn ..."; \
MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared $$fn || exit 1; \
View
22 mono/tests/generic-virtual2.2.cs
@@ -0,0 +1,22 @@
+public struct GenStruct<T> {
+}
+
+public class Gen<T> {
+ public object doCall<S> (GenStruct<T> x) {
+ return newArr (x);
+ }
+
+ public object newArr (GenStruct<T> x) {
+ return new T [3];
+ }
+}
+
+public class main {
+ public static int Main () {
+ Gen<string> gs = new Gen<string> ();
+
+ if (gs.doCall<object> (new GenStruct<string> ()).GetType () != typeof (string []))
+ return 1;
+ return 0;
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.