[Mono-bugs] [Bug 536637] New: Expression.Call() can't find Queryable.Select()
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Thu Sep 3 14:32:17 EDT 2009
http://bugzilla.novell.com/show_bug.cgi?id=536637
Summary: Expression.Call() can't find Queryable.Select()
Classification: Mono
Product: Mono: Class Libraries
Version: unspecified
Platform: x86-64
OS/Version: openSUSE 11.1
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Sys.Core
AssignedTo: jbevain at novell.com
ReportedBy: jpryor at novell.com
QAContact: mono-bugs at lists.ximian.com
Found By: ---
System.Linq.Expressions.Expression.Call() can't find
System.Linq.Queryable.Select().
To reproduce, compile and run the following code:
using System;
using System.Linq;
using System.Linq.Expressions;
class Test {
public static void Main ()
{
var param = Expression.Parameter(typeof(string), "s");
var sel = Expression.Property(param,
typeof(string).GetProperty("Length"));
var pred = Expression.Lambda(sel, param);
var strs = new string[]{"1", "22", "333"};
var expr = Expression.Call (typeof (Queryable),
"Select",
new Type[]{ typeof (string), typeof (int)},
Expression.Constant (strs.AsQueryable ()),
pred);
var q = strs.AsQueryable ().Provider.CreateQuery<int> (expr);
var list = q.ToList();
Console.WriteLine("List.Count={0}", list.Count);
// prints: 1, 2, 3
foreach (var v in list)
Console.WriteLine (v);
Console.WriteLine("Done");
}
}
Expected results:
List.Count=3
1
2
3
Done
The above is what .NET 3.5 produces.
Actual results:
Unhandled Exception: System.InvalidOperationException: No such method
at System.Linq.Expressions.Expression.TryGetMethod (System.Type type,
System.String methodName, BindingFlags flags, System.Type[] parameterTypes,
System.Type[] argumentTypes) [0x00000]
at System.Linq.Expressions.Expression.Call (System.Type type, System.String
methodName, System.Type[] typeArguments, System.Linq.Expressions.Expression[]
arguments) [0x00000]
at Test.Main () [0x00000]
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list