[Mono-dev] gmcs compiler exception (was Re: Call for testing: Mono 1.2.4 Preview Available)

Steve Bjorg steveb at mindtouch.com
Sat Apr 21 11:14:49 EDT 2007

When attempting to compile the attached code, gmcs fails:

$ gmcs test.cs

Unhandled Exception: Mono.CSharp.InternalErrorException: test.cs 
(4,33): Test.ExtensionHandler ---> System.ArgumentNullException:  
Argument cannot be null.
Parameter name: con
   at System.Reflection.Emit.CustomAttributeBuilder.Initialize  
(System.Reflection.ConstructorInfo con, System.Object[]  
constructorArgs, System.Reflection.PropertyInfo[] namedProperties,  
System.Object[] propertyValues, System.Reflection.FieldInfo[]  
namedFields, System.Object[] fieldValues) [0x00000]
   at System.Reflection.Emit.CustomAttributeBuilder..ctor  
(System.Reflection.ConstructorInfo con, System.Object[]  
constructorArgs) [0x00000]
   at Mono.CSharp.ParamsParameter.ApplyAttributes  
(System.Reflection.Emit.MethodBuilder mb,  
System.Reflection.Emit.ConstructorBuilder cb, Int32 index) [0x00000]
   at Mono.CSharp.Parameters.ApplyAttributes  
(System.Reflection.MethodBase builder) [0x00000]
   at Mono.CSharp.Delegate.Define () [0x00000]
   at Mono.CSharp.TypeContainer 
+MemberCoreArrayList.DefineContainerMembers () [0x00000] --- End of  
inner exception stack trace ---

   at Mono.CSharp.TypeContainer 
+MemberCoreArrayList.DefineContainerMembers () [0x00000]
   at Mono.CSharp.TypeContainer.DefineContainerMembers  
(Mono.CSharp.MemberCoreArrayList mcal) [0x00000]
   at Mono.CSharp.Class.DefineContainerMembers  
(Mono.CSharp.MemberCoreArrayList list) [0x00000]
   at Mono.CSharp.TypeContainer.DoDefineMembers () [0x00000]
   at Mono.CSharp.Class.DoDefineMembers () [0x00000]
   at Mono.CSharp.TypeContainer.DefineMembers () [0x00000]
   at Mono.CSharp.RootContext.PopulateTypes () [0x00000]
   at Mono.CSharp.Driver.MainDriver (System.String[] args) [0x00000]
   at Mono.CSharp.Driver.Main (System.String[] args) [0x00000]

This is the code:

public class Test {
     public static void Main(string[] argS) { }
     private delegate object ExtensionHandler(params object[] args);

Removing params from the delegate declaration avoids the compiler  
error exception.

- Steve

Steve G. Bjorg

On Apr 20, 2007, at 9:26 PM, Wade Berrier wrote:

> Hi,
> Mono 1.2.4 preview sources, packages, and installers are available at:
> http://mono.ximian.com/monobuild/preview/download-preview/
> The beginnings of the release notes for 1.2.4 are available at:
> http://go-mono.com/archive/1.2.4/
> If no critical bugs are found after the preview period, these same
> downloads will be posted on mono-project.com for general consumption.
> If there are critical bugs found, only those packages/sources will be
> updated before publishing to mono-project.com.
> Since this release hasn't been pushed to our main download server,  
> some
> sources may be retagged if critical bugs are found.  Those tags are  
> not
> final until we publish to mono-project.com.
> Wade
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cs
Type: application/octet-stream
Size: 134 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070421/7d4d546f/attachment.obj 
-------------- next part --------------

More information about the Mono-devel-list mailing list