Partager via


Mono + Anonymous delegates

Tried to get my code to compile but i got this error:

 
cyrusn@Foo ~> /opt/local/bin/gmcs foo.cs
Mono C# Compiler 0.91.0.0 for Generics
System.NullReferenceException: Object reference not set to an instance of an object
in <0x14828> Mono.CSharp.CSharpParser:yyparse (Mono.CSharp.yyParser.yyInput)
in <0x000b4> Mono.CSharp.CSharpParser:parse ()

foo.cs(30) error CS8025: Parsing error
Compilation failed: 1 error(s), 0 warnings

Not encouraged by the exception, but it is experimental code in a piece of beta software. (and my own code throws exceptions, so who am i to talk :-) ). However, it did give me the line number (yaaay). I went there and saw that it was this bit of code:

 
    public Creator<>> Drop(int elements) {<br>        return delegate { return this; };<br>    }

I'm wondering if it's anonymous delegates. I'll see if i can figure out what's going on and maybe how to work around it. I also filed this this bug to help out the mono developers.

Comments