Bug 10552 - MT has disabled verifier which breaks constraints check on generic methods
Summary: MT has disabled verifier which breaks constraints check on generic methods
Status: RESOLVED FEATURE
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 6.3.x
Hardware: PC Mac OS
: Lowest enhancement
Target Milestone: Untriaged
Assignee: Rodrigo Kumpera
URL:
Depends on:
Blocks:
 
Reported: 2013-02-21 15:33 UTC by Marek Safar
Modified: 2013-08-26 13:17 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FEATURE

Description Marek Safar 2013-02-21 15:33:13 UTC
Fails on device (extracted from mscorlib tests)

		public class FakeString {
			public int length;
			public char start_char;
		}
		
		private static FakeString UnsafeConversion<T> (T thing) where T : FakeString
		{
			return thing;
		}
		
		[Test]
		public void MutableString ()
		{
			var m = typeof (Tests).GetMethod ("UnsafeConversion", BindingFlags.NonPublic | BindingFlags.Static);
			try {
				var m2 = m.MakeGenericMethod (typeof (string));
				Assert.Fail ("MakeGenericMethod");
			}
			catch (ArgumentException e) {
				return;
			}
		}
Comment 1 Zoltan Varga 2013-03-08 19:14:35 UTC
Those tests are now disabled until this is fixed. They are:
- MethodBaseTest.MutableString ()
- MethodInfoTest.MakeGenericMethodRespectConstraints ()
Comment 2 Miguel de Icaza [MSFT] 2013-03-11 12:30:07 UTC
I think it is fine to disable this test for device.

It does not prevent working code form working, it merely allows broken code to run on device, but this could be caught by the simulator.

The price of adding the verifier for everyone to deal with a corner case seems like too big of a price to pay.
Comment 3 Zoltan Varga 2013-03-11 13:01:59 UTC
This doesn't need the full verifier, only a small subset which checks generic constraints. But that code is deeply integrated into the current verifier, so it would require some work to extract it.
Comment 4 Rodrigo Kumpera 2013-08-26 13:17:04 UTC
The resolution was that we'll remain broken on device.