diff --git a/mcs/mcs/generic.cs b/mcs/mcs/generic.cs index 0659590049947..edf488e30906f 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 0000000000000..82dcb7c2e4142 --- /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 3f0f05520280b..6e4c500e386e8 100644 --- a/mcs/tests/ver-il-dmcs.xml +++ b/mcs/tests/ver-il-dmcs.xml @@ -2296,6 +2296,19 @@ + + + + 1 + + + 1 + + + 7 + + +