Skip to content

Commit

Permalink
Fixed CLS compliance check for generic parameters of type dynamic
Browse files Browse the repository at this point in the history
(Fixes Bug #645232)
  • Loading branch information
e-tobi committed Oct 10, 2010
1 parent 0440378 commit 8275316
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mcs/mcs/generic.cs
Expand Up @@ -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;
}
Expand Down
15 changes: 15 additions & 0 deletions 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<dynamic> parameter)
{
}
}
13 changes: 13 additions & 0 deletions mcs/tests/ver-il-dmcs.xml
Expand Up @@ -2296,6 +2296,19 @@
</method>
</type>
</test>
<test name="dtest-037.cs">
<type name="A">
<method name="Void Main()">
<size>1</size>
</method>
<method name="Void CLSCompliantMethod(IEnumerable`1)">
<size>1</size>
</method>
<method name="Void .ctor()">
<size>7</size>
</method>
</type>
</test>
<test name="dtest-collectioninit-01.cs">
<type name="Test">
<method name="Int32 Main()">
Expand Down

0 comments on commit 8275316

Please sign in to comment.