Bug 413414

Summary: gmcs doesn't special case Nullable<> constraints
Product: [Mono] Mono: Compilers Reporter: Rodrigo Kumpera <rkumpera>
Component: C#Assignee: Mono Bugs <mono-bugs>
Status: RESOLVED DUPLICATE QA Contact: Mono Bugs <mono-bugs>
Severity: Minor    
Priority: P5 - None    
Version: SVN   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Rodrigo Kumpera 2008-07-30 22:05:57 UTC
Under MS, Nullable<> is declared as: "Nullable<T> where T: struct, new()".

This construct is not allowed for regular C# code, but it happens to work for Nullable.

This property might be verified by running the following program under MS and mono:

using System;
class Driver
{
	public static void Main ()
	{
		Console.WriteLine (typeof (Nullable<>).GetGenericArguments()[0].GenericParameterAttributes);
	}
}


MS reports: 
NotNullableValueTypeConstraint, DefaultConstructorConstraint

Mono reports:
NotNullableValueTypeConstraint


This is not a SRE issue as the API allows for such constraints to be defined.
Comment 1 Marek Safar 2008-09-19 15:11:32 UTC

*** This bug has been marked as a duplicate of bug 416110 ***