Bug 12126 - System.Linq.Expression fails inside generic class on device
Summary: System.Linq.Expression fails inside generic class on device
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 6.3.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
Depends on:
Reported: 2013-05-06 19:16 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2013-05-08 08:22 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

TestCase.zip (4.69 KB, application/zip)
2013-05-06 19:16 UTC, Rolf Bjarne Kvinge [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Rolf Bjarne Kvinge [MSFT] 2013-05-06 19:16:19 UTC
Created attachment 3922 [details]

    * Run the provided sample on device.
    * This exception will show up:

System.ArgumentException: field
  at System.Linq.Expressions.Expression.Field (System.Linq.Expressions.Expression expression, System.Reflection.FieldInfo field) [0x00049] in /Developer/MonoTouch/Source/mono/mcs/class/System.Core/System.Linq.Expressions/Expression.cs:1354 
  at TestLib.TestClass.BindHidden[TC,Boolean] (TestLib.Foo target, TestLib.TC source, System.Linq.Expressions.Expression`1 sourcePropertyAccessor) [0x0000f] in /Users/rolf/Library/Caches/Opera/temporary_downloads/ReflectionTest/tmp/ReflectionTest/TestClass.cs:27 

The sample executes successfully in the simulator.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2013-05-06 19:16:43 UTC
Zoltan, is this running into one of our generics limitations?
Comment 3 Oliver Weichhold 2013-05-07 02:19:24 UTC
The problem appears to be related to introducing a second Expression<Func<T>> to the method. In this case the "sourcePropertyAccessor" argument.
Comment 4 Zoltan Varga 2013-05-08 08:22:42 UTC
Fixed in master(420ba5e9986351c0ce4bb5c8a7ff9d7c626fa637), 2.10 (7e4adab08fb1607e865659384fe2cda751b54991), and mobile-master(7b73ccbef5d85d6cdba6ba93e58512ec327cc250).