[Mono-devel-list] Expression denotes a 'variable' where a 'method group' was expected

Miguel de Icaza miguel at ximian.com
Mon Oct 13 16:37:16 EDT 2003


Hello,

> I've been going through the source of OJB.NET and its build file making
> changes so that it will compile on Mono/Linux.  I've come across the
> error CS0119:
>   Expression denotes a 'variable' where a 'method group' 
>   was expected
> The code that follows looks OK to me, so I'm not sure if its a bug in
> Mono or if its just simply not allowed.  The problematic part is
> encapsulated by [error] tags.  Any suggestions on how to fix this?
> 
> ==== Code Snippet ====
> 
>     /// <summary>
>     /// Applies a IDictionary function to every object in a Set.
>     /// </summary>
>     /// <param name="s">The Set to be Mapped.</param>
>     /// <param name="m">IDictionary function for Set.</param>
>     /// <returns>A new Set with Mapped values.</returns>
>     public Set MapToSet(Set s, IDictionary mDict)
>     {
>       Set newset = new Set();
>       object[] array = new Object[s.Count];
>       int i = 0;
>       foreach (object o in s) {
> [ERROR]
>         array[i++] = mDict(o);
> [/ERROR]


I had never seen this syntax before Interface(parameter).   mDict(o)
really should be changed to something else.



More information about the Mono-devel-list mailing list