[Mono-list] mcs: combining delegates in invocation_expressions

Daniel Stodden stodden@in.tum.de
03 May 2002 10:15:40 +0200


--=-jCUSwkuU3ydFFmSNP9ek
Content-Type: text/plain
Content-Transfer-Encoding: 7bit


hi.

mcs currently chokes on expressions like

del1 = new MyDelegate( Hello );
del2 = new MyDelegate( World );
(del1 + del2)( 42 ); // this one

i've looked through cs-parser but been unable to find the problem so
far.

but i've found the .jay file at some places being different from the
ECMA documentation. just because i'm curious: why?

sample attached.

regards,
dns

-- 
___________________________________________________________________________
 mailto:stodden@in.tum.de

--=-jCUSwkuU3ydFFmSNP9ek
Content-Disposition: attachment; filename=testdelegate2.cs
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; name=testdelegate2.cs; charset=ISO-8859-1


using System;

class TestDelegate
{
	delegate void MyDelegate( int i );
=09
	static void Hello( int i )
	{
		Console.WriteLine( "Hello: {0}", i );
	}

	static void World( int i )
	{
		Console.WriteLine( "World: {0}", i );
	}

	static void Main()
	{
		MyDelegate del1 =3D new MyDelegate( Hello );
		MyDelegate del2 =3D new MyDelegate( World );
	=09
		(del1 + del2)( 42 );
	}
}

--=-jCUSwkuU3ydFFmSNP9ek--