[Mono-bugs] [Bug 623785] New: Internal Compiler Error: anonymous function, linq, local variable, method parameter
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Jul 20 04:13:14 EDT 2010
http://bugzilla.novell.com/show_bug.cgi?id=623785
http://bugzilla.novell.com/show_bug.cgi?id=623785#c0
Summary: Internal Compiler Error: anonymous function, linq,
local variable, method parameter
Classification: Mono
Product: Mono: Compilers
Version: SVN
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: achille.fouilleul at gadz.org
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Blocker: ---
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.6)
Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)
The C# compiler crashes when attempting to compiling the program below:
using System;
using System.Linq;
static class Ice
{
static void Eval(Func<int> f)
{
Console.WriteLine(f());
}
static void Main()
{
Eval(
delegate
{
int x = 42;
return (
from y in new[] { 42 }
where y == x
select y
).Single();
});
}
}
Tested with various versions of gmcs, including and up to SVN 141701, with
always the same error message ("Expression Mono.CSharp.LocalVariableReference
did not set its type after Resolve"). MS csc 3.5 and 4.0 compile it
successfully.
The reference to a local variable from the Linq expression inside an anonymous
function passed as a method parameter seems to cause the crash. All of these
elements need to be present for the problem to appear.
Reproducible: Always
Steps to Reproduce:
gmcs ice.cs
Actual Results:
internal compiler error (ICE)
Expected Results:
generation of a program that prints 42 on the standard output.
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list