From 8275316bf1c6a2ce4d616a21087622630fdd04db Mon Sep 17 00:00:00 2001 From: etobi Date: Sun, 10 Oct 2010 13:55:55 +0200 Subject: [PATCH] Fixed CLS compliance check for generic parameters of type dynamic (Fixes Bug #645232) --- mcs/mcs/generic.cs | 2 ++ mcs/tests/dtest-037.cs | 15 +++++++++++++++ mcs/tests/ver-il-dmcs.xml | 13 +++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 mcs/tests/dtest-037.cs diff --git a/mcs/mcs/generic.cs b/mcs/mcs/generic.cs index 065959004994..edf488e30906 100644 --- a/mcs/mcs/generic.cs +++ b/mcs/mcs/generic.cs @@ -1351,6 +1351,8 @@ protected override bool IsNotCLSCompliant () return true; foreach (var ta in TypeArguments) { + if (ta == InternalType.Dynamic) + return false; if (ta.MemberDefinition.IsNotCLSCompliant ()) return true; } diff --git a/mcs/tests/dtest-037.cs b/mcs/tests/dtest-037.cs new file mode 100644 index 000000000000..82dcb7c2e414 --- /dev/null +++ b/mcs/tests/dtest-037.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +[assembly:CLSCompliant(true)] + +public class A +{ + public static void Main () + { + } + + public void CLSCompliantMethod (IEnumerable parameter) + { + } +} diff --git a/mcs/tests/ver-il-dmcs.xml b/mcs/tests/ver-il-dmcs.xml index 3f0f05520280..6e4c500e386e 100644 --- a/mcs/tests/ver-il-dmcs.xml +++ b/mcs/tests/ver-il-dmcs.xml @@ -2296,6 +2296,19 @@ + + + + 1 + + + 1 + + + 7 + + +