https://bugzilla.novell.com/show_bug.cgi?id=355145
Summary: Type inference doesn't work with lambda expressions.
Product: Mono: Compilers
Version: SVN
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
Hi Marek,
I know this is currently under heavy development, but this code can't compile
and compiler returns bogus errors (I am used to see NotImplementedException
when something is not implemented, so this is probably not a known bug):
using System;
using System.Linq;
using System.Linq.Expressions;
class M
{
public static void Foo<T> (Expression<Func<T, T>> x)
{
}
public static void Main ()
{
Foo<int> ((i) => i);
// test.cs(13,5): error CS0308: The non-generic method
`M.Foo<int>(System.Linq.Expressions.Expression<System.Func<int,int>>)' cannot
be used with the type arguments
Foo ((int i) => i);
// test.cs(16,5): error CS0411: The type arguments for method
`M.Foo<T>(System.Linq.Expressions.Expression<System.Func<T,T>>)' cannot be
inferred from the usage. Try specifying the type arguments explicitly
Expression<Func<int, int>> func = (i) => i;
Foo (func);
// compiles fine
}
}
--
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