https://bugzilla.novell.com/show_bug.cgi?id=384584
Summary: generic type parameters not recognized within nested
anonymous methods
Product: Mono: Compilers
Version: 1.9.0
Platform: x86
OS/Version: Windows XP
Status: NEW
Severity: Major
Priority: P5 - None
Component: C#
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: Third Party Developer/Partner
The following code fails to compile in gmcs 1.9.1:
using System;
public static class A
{
public static void Fail<X>()
{
EventHandler t = delegate
{
t = delegate { X foo; };
};
}
}
a.cs(8,28): error CS0246: The type or namespace name `X' could not be found.
Are you missing a using directive or an assembly reference?
Compilation failed: 1 error(s), 0 warnings
This compiles successfully on microsoft compilers. It seems like the 'X'
parameter to the generic permeates the outer delegate but not the inner one (as
this bug does not reproduce unless there is nesting among the anonymous
methods).
If there is another X available (e.g. if someone did using X = System; or
defined a type called X) then X will resolve to that instead of the lexically
prevalent argument to the generic type
--
Configure bugmail: https://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.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs