https://bugzilla.novell.com/show_bug.cgi?id=386068
Summary: Compiler crash when method parameter used in LINQ
expression
Product: Mono: Compilers
Version: SVN
Platform: All
OS/Version: Linux
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
Marek, thanks for your fantastic work on expression trees.
I see the implementation in compiler is finished so I hope it is fine to start
with bug reporting :).
It seems that when method parameters are used in expressions, like in the
following code:
using System;
using System.Linq.Expressions;
class Foo
{
public void Goo (bool hoo)
{
bool _hoo = hoo;
Expression<Predicate<Foo>> x = obj => hoo; // doesn't work
Expression<Predicate<Foo>> y = obj => _hoo; // works
}
}
The compiler crashes with:
Unhandled Exception: Mono.CSharp.InternalErrorException: foo.cs(5,7): Foo --->
System.InvalidOperationException: Method 'Foo.Goo' does not have a method body.
at System.Reflection.Emit.MethodBuilder.fixup () [0x00000]
at System.Reflection.Emit.TypeBuilder.CreateType () [0x00000]
at Mono.CSharp.TypeContainer.CloseType () [0x00000] --- End of inner
exception stack trace ---
at Mono.CSharp.TypeContainer.CloseType () [0x00000]
at Mono.CSharp.RootContext.CloseTypes () [0x00000]
at Mono.CSharp.Driver.Compile () [0x00000]
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000]
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs