[Mono-bugs] [Bug 701187] New: Linq: Expression.CheckMethodArguments fails on Concat of two IQueryables with Cast

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Jun 21 04:21:53 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=701187

https://bugzilla.novell.com/show_bug.cgi?id=701187#c0


           Summary: Linq: Expression.CheckMethodArguments fails on Concat
                    of two IQueryables with Cast
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.10.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Core
        AssignedTo: jbevain at novell.com
        ReportedBy: david at dasz.at
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=435607)
 --> (http://bugzilla.novell.com/attachment.cgi?id=435607)
Testprogram

Please see the attached file for the full code. The most important part is this
Linq statement:

    var result = bs.Cast<A>().Concat(cs.Cast<A>()).Count();

where both bs and cs are IQueryables of sub-classes of A.


Testoutput:

[mono/local] ccnet at squeeze:~/tmp$ gmcs ./Program.cs
[mono/local] ccnet at squeeze:~/tmp$ mono --debug ./Program.exe

Unhandled Exception: System.ArgumentException: arguments
  at System.Linq.Expressions.Expression.CheckMethodArguments
(System.Reflection.MethodBase method, IEnumerable`1 args) [0x000a8] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq.Expressions/Expression.cs:1954
  at System.Linq.Expressions.Expression.Call
(System.Linq.Expressions.Expression instance, System.Reflection.MethodInfo
method, IEnumerable`1 arguments) [0x00075] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq.Expressions/Expression.cs:1033
  at System.Linq.Expressions.Expression.Call
(System.Linq.Expressions.Expression instance, System.Reflection.MethodInfo
method, System.Linq.Expressions.Expression[] arguments) [0x00000] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq.Expressions/Expression.cs:1019
  at System.Linq.QueryableTransformer.ReplaceQueryableMethod
(System.Linq.Expressions.MethodCallExpression old) [0x0007b] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq/QueryableTransformer.cs:92
  at System.Linq.QueryableTransformer.VisitMethodCall
(System.Linq.Expressions.MethodCallExpression methodCall) [0x00010] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq/QueryableTransformer.cs:46
  at System.Linq.Expressions.ExpressionTransformer.Visit
(System.Linq.Expressions.Expression exp) [0x0012d] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq.Expressions/ExpressionTransformer.cs:95
  at System.Linq.QueryableTransformer.ReplaceQueryableMethod
(System.Linq.Expressions.MethodCallExpression old) [0x00046] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq/QueryableTransformer.cs:87
  at System.Linq.QueryableTransformer.VisitMethodCall
(System.Linq.Expressions.MethodCallExpression methodCall) [0x00010] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq/QueryableTransformer.cs:46
  at System.Linq.Expressions.ExpressionTransformer.Visit
(System.Linq.Expressions.Expression exp) [0x0012d] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq.Expressions/ExpressionTransformer.cs:95
  at System.Linq.Expressions.ExpressionTransformer.Transform
(System.Linq.Expressions.Expression expression) [0x00000] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq.Expressions/ExpressionTransformer.cs:41
  at System.Linq.QueryableEnumerable`1[A].TransformQueryable
(System.Linq.Expressions.Expression expression) [0x00000] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq/QueryableEnumerable.cs:103
  at System.Linq.QueryableEnumerable`1[A].Execute[Int32]
(System.Linq.Expressions.Expression expression) [0x00000] in <filename
unknown>:0
  at System.Linq.Queryable.Execute[Int32,A] (IQueryable`1 source,
System.Reflection.MethodBase current) [0x00000] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq/Queryable.cs:55
  at System.Linq.Queryable.Count[A] (IQueryable`1 source) [0x00006] in
/srv/CCNet/mono/src/mono.local/mcs/class/System.Core/System.Linq/Queryable.cs:446
  at D.Main () [0x00000] in <filename unknown>:0


This works on MS.net 3.5 SP1 an prints the expected result ( 4 items )


I was not able to test against master as the build currently fails for me.

-- 
Configure bugmail: https://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