diff options
author | Marek Safar <marek.safar@gmail.com> | 2006-04-08 00:57:24 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2006-04-08 00:57:24 +0400 |
commit | 044d712c725903cd73cf7da74a1a9c1ff4b1aec2 (patch) | |
tree | aa713aefdc8e8691a3d476bd09487bfe3efcd5e2 /mcs/tests/test-39.cs | |
parent | 91ad296a3fa3f8303e7c9b29200ed5245dd5ac16 (diff) |
2006-04-07 Marek Safar <marek.safar@seznam.cz>
A fix for #77916.
expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
array.
svn path=/trunk/mcs/; revision=59229
Diffstat (limited to 'mcs/tests/test-39.cs')
-rw-r--r-- | mcs/tests/test-39.cs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/mcs/tests/test-39.cs b/mcs/tests/test-39.cs index e1d6897c9eb..72035a58c90 100644 --- a/mcs/tests/test-39.cs +++ b/mcs/tests/test-39.cs @@ -45,16 +45,36 @@ public interface IFoo { bool MethodTwo (float x, float y); } +[Simple ("Fifth", D=new double[] { -1 })] +class Blah2 +{ +} + +[Simple ("Fifth", D=new double[0])] +class Blah3 +{ +} + [Simple ("Dummy", MyNamedArg = "Dude!")] [Simple ("Vids", MyNamedArg = "Raj", AnotherArg = "Foo")] [Simple ("Trip", LongValue=0)] [Simple ("Fourth", ArrayValue=new long[] { 0 })] -//[Simple ("Fifth", D=new double[] { -1 })] // runtime bug #77916 public class Blah { public static int Main () { - Console.WriteLine ("A dummy app which tests attribute emission"); + object o = (((SimpleAttribute)typeof(Blah2).GetCustomAttributes (typeof (SimpleAttribute), false)[0]).D); + if (o.ToString () != "System.Double[]") + return 1; + + if (((double[])o)[0].GetType () != typeof (double)) + return 2; + + o = (((SimpleAttribute)typeof(Blah3).GetCustomAttributes (typeof (SimpleAttribute), false)[0]).D); + if (o.ToString () != "System.Double[]") + return 3; + + Console.WriteLine ("OK"); return 0; } } |