diff options
author | Marek Safar <marek.safar@gmail.com> | 2013-06-06 13:54:20 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2013-06-06 13:54:20 +0400 |
commit | a4fdd2cf6ef124be3c9ffbbb6f1e64661e045f13 (patch) | |
tree | cd5c832605590da7f527439dbc46e9436e4737d7 /mcs | |
parent | 8d89242edbdac799648c279eabed22d287d0bbce (diff) |
Correct encoding transformation flags for type arguments arrays without dynamic element. Fixes #12572
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/mcs/attribute.cs | 2 | ||||
-rw-r--r-- | mcs/tests/dtest-001.cs | 7 | ||||
-rw-r--r-- | mcs/tests/ver-il-net_4_5.xml | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/mcs/mcs/attribute.cs b/mcs/mcs/attribute.cs index a76a59f7537..fb2bca4bd55 100644 --- a/mcs/mcs/attribute.cs +++ b/mcs/mcs/attribute.cs @@ -1988,7 +1988,7 @@ namespace Mono.CSharp { if (ac != null) { element = GetTransformationFlags (ac.Element); if (element == null) - return null; + return new bool[] { false, false }; bool[] res = new bool[element.Length + 1]; res[0] = false; diff --git a/mcs/tests/dtest-001.cs b/mcs/tests/dtest-001.cs index 06f2fed3fde..f0b58ef8b9a 100644 --- a/mcs/tests/dtest-001.cs +++ b/mcs/tests/dtest-001.cs @@ -36,6 +36,7 @@ class C public dynamic[,] t2; public Func<dynamic, int, dynamic[]> v; public I<dynamic>[] iface; + public Action<int[], object, dynamic> d2; } delegate dynamic Del (dynamic d); @@ -135,6 +136,12 @@ class Test if (!da.TransformFlags.SequenceEqual (new bool[] { false, false, true })) return 47; + da = t.GetMember ("d2")[0].GetCustomAttributes (ca, false)[0] as DynamicAttribute; + if (da == null) + return 48; + if (!da.TransformFlags.SequenceEqual (new bool[] { false, false, false, false, true })) + return 49; + t = typeof (Del); if (t.GetMember ("Invoke")[0].GetCustomAttributes (ca, false).Length != 0) diff --git a/mcs/tests/ver-il-net_4_5.xml b/mcs/tests/ver-il-net_4_5.xml index 8ced909369a..3e0968ad09d 100644 --- a/mcs/tests/ver-il-net_4_5.xml +++ b/mcs/tests/ver-il-net_4_5.xml @@ -41,7 +41,7 @@ </type>
<type name="Test">
<method name="Int32 Main()" attrs="150">
- <size>1216</size>
+ <size>1292</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
|