Author: raja
Date: 2005-04-05 11:03:54 -0400 (Tue, 05 Apr 2005)
New Revision: 42573

Added:
   trunk/mcs/tests/mtest-8-dll.cs
   trunk/mcs/tests/mtest-8-exe.cs
Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/delegate.cs
   trunk/mcs/mcs/typemanager.cs
   trunk/mcs/tests/ChangeLog
   trunk/mcs/tests/Makefile
Log:
In mcs:
2005-04-05  Abin Thomas  <[EMAIL PROTECTED]>
            Anoob V.E  <[EMAIL PROTECTED]>
            Harilal P.R  <[EMAIL PROTECTED]>
            Raja R Harinath  <[EMAIL PROTECTED]>

        Fix #73820.
        * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
        attribute.
        * typemanager (GetConstructor): Make public.

In tests:
        * mtest-8-dll.cs, mtest-8-exe.cs: New test from #73820.


Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2005-04-05 15:02:48 UTC (rev 42572)
+++ trunk/mcs/mcs/ChangeLog     2005-04-05 15:03:54 UTC (rev 42573)
@@ -1,3 +1,13 @@
+2005-04-05  Abin Thomas         <[EMAIL PROTECTED]>
+           Anoob V.E  <[EMAIL PROTECTED]>
+           Harilal P.R  <[EMAIL PROTECTED]>
+           Raja R Harinath  <[EMAIL PROTECTED]>
+
+       Fix #73820.
+       * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
+       attribute.
+       * typemanager (GetConstructor): Make public.
+
 2005-04-05  John Luke  <[EMAIL PROTECTED]>
            Raja R Harinath  <[EMAIL PROTECTED]>
 

Modified: trunk/mcs/mcs/delegate.cs
===================================================================
--- trunk/mcs/mcs/delegate.cs   2005-04-05 15:02:48 UTC (rev 42572)
+++ trunk/mcs/mcs/delegate.cs   2005-04-05 15:03:54 UTC (rev 42573)
@@ -85,7 +85,8 @@
                                TypeAttributes.Class | TypeAttributes.Sealed;
 
                        if (TypeManager.multicast_delegate_type == null && 
!RootContext.StdLib) {
-                               TypeExpr expr = new TypeLookupExpression 
("System.MulticastDelegate");
+                               Namespace system = Namespace.LookupNamespace 
("System", true);
+                               TypeExpr expr = system.Lookup (this, 
"MulticastDelegate", Location) as TypeExpr;
                                TypeManager.multicast_delegate_type = 
expr.ResolveType (ec);
                        }
 
@@ -246,7 +247,24 @@
                        }
                        if (Parameters.ArrayParameter != null){
                                Parameter p = Parameters.ArrayParameter;
-                               p.DefineParameter (ec, InvokeBuilder, null, i + 
1, Location);
+
+                               if (TypeManager.param_array_type == null && 
!RootContext.StdLib) {
+                                       Namespace system = 
Namespace.LookupNamespace ("System", true);
+                                       TypeExpr expr = system.Lookup (this, 
"ParamArrayAttribute", Location) as TypeExpr;
+                                       TypeManager.param_array_type = 
expr.ResolveType (ec);
+                               }
+
+                               if (TypeManager.cons_param_array_attribute == 
null) {
+                                       Type [] void_arg = { };
+                                       TypeManager.cons_param_array_attribute 
= TypeManager.GetConstructor (
+                                               TypeManager.param_array_type, 
void_arg);
+                               }
+
+                               ParameterBuilder pb = 
InvokeBuilder.DefineParameter (
+                                       i + 1, 
Parameters.ArrayParameter.Attributes,Parameters.ArrayParameter.Name);
+                               
+                               pb.SetCustomAttribute (
+                                       new CustomAttributeBuilder 
(TypeManager.cons_param_array_attribute, new object [0]));
                        }
                        
                        InvokeBuilder.SetImplementationFlags 
(MethodImplAttributes.Runtime);

Modified: trunk/mcs/mcs/typemanager.cs
===================================================================
--- trunk/mcs/mcs/typemanager.cs        2005-04-05 15:02:48 UTC (rev 42572)
+++ trunk/mcs/mcs/typemanager.cs        2005-04-05 15:03:54 UTC (rev 42573)
@@ -967,7 +967,7 @@
        /// <summary>
        ///    Returns the ConstructorInfo for "args"
        /// </summary>
-       static ConstructorInfo GetConstructor (Type t, Type [] args)
+       public static ConstructorInfo GetConstructor (Type t, Type [] args)
        {
                MemberList list;
                Signature sig;

Modified: trunk/mcs/tests/ChangeLog
===================================================================
--- trunk/mcs/tests/ChangeLog   2005-04-05 15:02:48 UTC (rev 42572)
+++ trunk/mcs/tests/ChangeLog   2005-04-05 15:03:54 UTC (rev 42573)
@@ -1,5 +1,7 @@
 2005-04-05  Raja R Harinath  <[EMAIL PROTECTED]>
 
+       * mtest-8-dll.cs, mtest-8-exe.cs: New test from #73820.
+
        * test-360.cs: New test from #74041.
 
 2005-04-01  Kamil Skalski  <[EMAIL PROTECTED]>

Modified: trunk/mcs/tests/Makefile
===================================================================
--- trunk/mcs/tests/Makefile    2005-04-05 15:02:48 UTC (rev 42572)
+++ trunk/mcs/tests/Makefile    2005-04-05 15:03:54 UTC (rev 42573)
@@ -32,7 +32,8 @@
                          test-333 test-311 test-335 test-336 test-337 test-287 
test-338 test-339 test-341 test-334 test-342 \
                          test-344 test-345 test-346 test-347 test-348 test-349 
test-350 test-351 test-352 test-353 test-354 test-355 \
                          test-356 test-357 test-358 test-359 test-360 \
-       mtest-7-dll mtest-7-exe
+       mtest-7-dll mtest-7-exe \
+       mtest-8-dll mtest-8-exe
 
 #
 # Please do _not_ add any tests here - all new tests should go into 
NEW_TEST_SOURCES_common

Added: trunk/mcs/tests/mtest-8-dll.cs
===================================================================
--- trunk/mcs/tests/mtest-8-dll.cs      2005-04-05 15:02:48 UTC (rev 42572)
+++ trunk/mcs/tests/mtest-8-dll.cs      2005-04-05 15:03:54 UTC (rev 42573)
@@ -0,0 +1,10 @@
+// Compiler options: -t:library
+
+using System;
+
+namespace blah
+{
+
+public delegate void MyFunnyDelegate(object sender, params object[] message);
+
+}

Added: trunk/mcs/tests/mtest-8-exe.cs
===================================================================
--- trunk/mcs/tests/mtest-8-exe.cs      2005-04-05 15:02:48 UTC (rev 42572)
+++ trunk/mcs/tests/mtest-8-exe.cs      2005-04-05 15:03:54 UTC (rev 42573)
@@ -0,0 +1,26 @@
+// Compiler options: -r:mtest-8-dll.dll
+
+using System;
+using blah;
+
+namespace blah2
+{
+
+public class MyClass
+{
+    public event MyFunnyDelegate DoSomething;
+
+    public void DoSomethingFunny()
+    {
+        if (DoSomething != null) DoSomething(this, "hello there", "my friend");
+    }
+
+       public static void Main(string[] args)
+       {
+               MyClass mc = new MyClass();
+               mc.DoSomethingFunny();
+
+       }
+}
+
+}

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to