Bug 34334

Summary: System.NotImplementedException: The requested feature is not implemented. at Microsoft.Scripting.Interpreter.EqualInstruction.Create (System.Type type) [0x001ab] in Microsoft.Dynamic/Interpreter/Instructions/EqualInstruction.cs:162
Product: iOS Reporter: developers
Component: BCL Class LibrariesAssignee: Alexander Köplinger [MSFT] <alkpli>
Status: VERIFIED FIXED    
Severity: normal CC: kumpera, masafa, mono-bugs+monotouch, pj.beaman, rolf, sebastien, shrutis
Priority: ---    
Version: XI 9.0 (iOS9)   
Target Milestone: Untriaged   
Hardware: Macintosh   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Solution showing the issues (bug 34334)

Description developers 2015-09-28 09:18:16 UTC
We have recently upgraded to xCode 7 and the latest stable releases of Xamarin. Since then, the following line crashes the application:
var predicate = PredicateBuilder.Create<DataType>(x => true);
predicate = predicate.And (x => x.Date < DateTime.UtcNow && (x.Name == null || x.Name == string.Empty));
var predicateCompiled = predicate.Compile();

PredicateBuilder from: https://petemontgomery.wordpress.com/2011/02/10/a-universal-predicatebuilder/

The code crashes on the Compile statement - see StackTrace at end. The code runs on iOS8 and iOS9 when we complied with xCode 6 and the prior stable release.

Before down-grading the software revisions, is there any known issues/limitations which explain the issue?

Xamarin About:
Xamarin Studio
Version 5.9.7 (build 9)
Installation UUID: a4abed14-a47b-4589-9f0e-8a7f068e0747
Runtime:
	Mono 4.0.4 ((detached/cb6d6b2)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400040002

Apple Developer Tools
Xcode 7.0 (8227)
Build 7A220

Xamarin.iOS
Version: 9.0.1.20 (Business Edition)
Hash: d8e9592
Branch: master
Build date: 2015-09-18 23:22:05-0400

Xamarin.Mac
Version: 2.0.2.111 (Starter Edition)

Xamarin.Android
Version: 5.1.6.7 (Business Edition)
Android SDK: /VE4D/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Xamarin Android Player
Not Installed

Build Information
Release ID: 509070009
Git revision: 31fa64709030b3edb971237780a452a4c69943c4
Build date: 2015-09-17 11:44:37-04
Xamarin addins: b105d33d8cd72911ff2cf3ee0b7715d37e5f19a6

Operating System
Mac OS X 10.10.5
Darwin VE4DLM-Andew.local 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64


Stack Trace
System.NotImplementedException: The requested feature is not implemented.
  at Microsoft.Scripting.Interpreter.EqualInstruction.Create (System.Type type) [0x001ab] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/EqualInstruction.cs:162
  at Microsoft.Scripting.Interpreter.InstructionList.EmitEqual (System.Type type, Boolean liftedResult) [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/InstructionList.cs:699
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileEqual (System.Linq.Expressions.Expression left, System.Linq.Expressions.Expression right, Boolean liftedResult) [0x0000e] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:604
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileBinaryExpression (System.Linq.Expressions.Expression expr) [0x00135] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:569
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00223] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1649
  at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00008] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1729
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileLogicalBinaryExpression (System.Linq.Expressions.Expression expr, Boolean andAlso) [0x00055] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:798
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileOrElseBinaryExpression (System.Linq.Expressions.Expression expr) [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:784
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00343] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1673
  at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00008] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1729
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileLogicalBinaryExpression (System.Linq.Expressions.Expression expr, Boolean andAlso) [0x00084] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:804
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileAndAlsoBinaryExpression (System.Linq.Expressions.Expression expr) [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:780
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00196] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1639
  at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00008] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1729
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileLogicalBinaryExpression (System.Linq.Expressions.Expression expr, Boolean andAlso) [0x00084] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:804
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileAndAlsoBinaryExpression (System.Linq.Expressions.Expression expr) [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:780
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00196] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1639
  at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00008] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1729
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileLogicalBinaryExpression (System.Linq.Expressions.Expression expr, Boolean andAlso) [0x00055] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:798
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileAndAlsoBinaryExpression (System.Linq.Expressions.Expression expr) [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:780
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00196] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1639
  at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00008] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1729
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileLogicalBinaryExpression (System.Linq.Expressions.Expression expr, Boolean andAlso) [0x00055] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:798
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileAndAlsoBinaryExpression (System.Linq.Expressions.Expression expr) [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:780
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00196] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1639
  at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00008] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1729
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileTop (System.Linq.Expressions.LambdaExpression node) [0x00055] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:221
  at Microsoft.Scripting.Generation.CompilerHelpers.LightCompile (System.Linq.Expressions.LambdaExpression lambda) [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Generation/CompilerHelpers.cs:619
  at System.Linq.Expressions.Compiler.LambdaCompiler.Compile (System.Linq.Expressions.LambdaExpression lambda, System.Runtime.CompilerServices.DebugInfoGenerator debugInfoGenerator) [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System.Core/System.Linq.Expressions.Interpret/LambdaCompiler.cs:41
  at System.Linq.Expressions.Expression`1[System.Func`2[CUSTOMCLASS,System.Boolean]].Compile () [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs:188
Comment 1 developers 2015-09-28 09:27:57 UTC
Forgot to mention that the crash occurs on both device and simulator for iOS9/iOS8.
Comment 2 developers 2015-09-28 09:37:12 UTC
A slightly different error with this code:
var predicate = PredicateBuilder.Create<TagPresWorklists>(x => true);
predicate = predicate.And (x => x.NextDueDate > DateTime.Today.AddDays(0 - int.Parse("5")));
var predicateCompiled = predicate.Compile();


System.NotImplementedException: Interpreter of ref types
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileMethodCallExpression (System.Linq.Expressions.Expression expr) [0x00075] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1283
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x001ba] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1642
  at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00008] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1729
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileBinaryExpression (System.Linq.Expressions.Expression expr) [0x00024] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:546
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x0023b] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1651
  at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00008] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1729
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileLogicalBinaryExpression (System.Linq.Expressions.Expression expr, Boolean andAlso) [0x00084] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:804
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileAndAlsoBinaryExpression (System.Linq.Expressions.Expression expr) [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:780
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileNoLabelPush (System.Linq.Expressions.Expression expr) [0x00196] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1639
  at Microsoft.Scripting.Interpreter.LightCompiler.Compile (System.Linq.Expressions.Expression expr) [0x00008] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:1729
  at Microsoft.Scripting.Interpreter.LightCompiler.CompileTop (System.Linq.Expressions.LambdaExpression node) [0x00055] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs:221
  at Microsoft.Scripting.Generation.CompilerHelpers.LightCompile (System.Linq.Expressions.LambdaExpression lambda) [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Generation/CompilerHelpers.cs:619
  at System.Linq.Expressions.Compiler.LambdaCompiler.Compile (System.Linq.Expressions.LambdaExpression lambda, System.Runtime.CompilerServices.DebugInfoGenerator debugInfoGenerator) [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System.Core/System.Linq.Expressions.Interpret/LambdaCompiler.cs:41
  at System.Linq.Expressions.Expression`1[System.Func`2[Com.Qedi.GoHub.GoPreserve.Shared.Models.TagPresWorklists,System.Boolean]].Compile () [0x00000] in /Users/builder/data/lanes/2077/d8e9592a/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs:188
Comment 3 developers 2015-09-28 09:57:35 UTC
I revised the DateTime code as follows:
var predicate = PredicateBuilder.Create<DataType>(x => true);
DateTime dtStart = DateTime.Today.AddDays(0 - int.Parse("5"));
predicate = predicate.And (x => x.Date > dtStart);
var predicateCompiled = predicate.Compile();

Based on this, it appears that the following is causing the ref type error:
predicate = predicate.And (x => x.NextDueDate > DateTime.Today.AddDays(0 -
int.Parse("5")));



Further to this, it seems the null check is causing the other issue:
var predicate = PredicateBuilder.Create<DataType>(x => true);
predicate = predicate.And (x => x.Name == string.Empty);
var predicateCompiled = predicate.Compile();
Comment 4 Rolf Bjarne Kvinge [MSFT] 2015-09-28 10:57:41 UTC
@Marek, this looks like something in your area.
Comment 5 developers 2015-09-28 20:57:02 UTC
Created attachment 13114 [details]
Solution showing the issues (bug 34334)

Here are the three test cases (working, null check and inline date check).
Comment 6 developers 2015-10-01 08:32:48 UTC
Tested with latest iOS and Mono. Same errors occur with the Sample Solution.

Xamarin Studio
Version 5.9.7 (build 9)
Installation UUID: a4abed14-a47b-4589-9f0e-8a7f068e0747
Runtime:
	Mono 4.0.4 ((detached/cb6d6b2)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400040004

Apple Developer Tools
Xcode 7.0.1 (8228)
Build 7A1001

Xamarin.iOS
Version: 9.0.1.20 (Business Edition)
Hash: d8e9592
Branch: master
Build date: 2015-09-18 23:22:05-0400

Xamarin.Mac
Version: 2.0.2.111 (Starter Edition)

Xamarin.Android
Version: 5.1.6.7 (Business Edition)
Android SDK: /VE4D/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Xamarin Android Player
Not Installed

Build Information
Release ID: 509070009
Git revision: 31fa64709030b3edb971237780a452a4c69943c4
Build date: 2015-09-17 11:44:37-04
Xamarin addins: b105d33d8cd72911ff2cf3ee0b7715d37e5f19a6

Operating System
Mac OS X 10.10.5
Darwin 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Comment 7 Rodrigo Kumpera 2015-10-01 13:30:44 UTC
Hey Marcos,

Could take a look at this one.
Comment 8 developers 2015-10-06 22:09:30 UTC
After latest Xamarin Stable upgrade [iOS and Studio updates only], same error with sample project.

=== Xamarin Studio ===

Version 5.9.7 (build 12)
Installation UUID: a4abed14-a47b-4589-9f0e-8a7f068e0747
Runtime:
	Mono 4.0.4 ((detached/d481017)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400040004

=== Apple Developer Tools ===

Xcode 7.0.1 (8228)
Build 7A1001

=== Xamarin.iOS ===

Version: 9.0.1.29 (Business Edition)
Hash: 1d27ac2
Branch: master
Build date: 2015-09-25 18:08:44-0400

=== Xamarin.Android ===

Version: 5.1.6.7 (Business Edition)
Android SDK: /VE4D/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Not Installed

=== Xamarin.Mac ===

Version: 2.0.2.111 (Starter Edition)

=== Build Information ===

Release ID: 509070012
Git revision: 2635bd7e508e5bc4c19438e45eefdd9a75232ecb
Build date: 2015-09-25 15:52:15-04
Xamarin addins: 6e0ed86be96e8bd589ba9bc0f50d7121c4dd0d30

=== Operating System ===

Mac OS X 10.10.5
Darwin 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Comment 9 developers 2015-10-07 01:00:59 UTC
We also have a need for a different DateTime predicate:

A slightly different error with this code:
var predicate = PredicateBuilder.Create<DataType>(x => true);
predicate = predicate.And (x => DateTime.Today < x.DueDate.AddDays(0 - int.Parse("5")));
var predicateCompiled = predicate.Compile();

This results in the same System.NotImplementedException: Interpreter of ref types

While we had a solution for the "Today" adjustment, by placing it as a separate variable - it does not however work for this other case.
Comment 10 Rodrigo Kumpera 2015-10-07 15:04:31 UTC
Hey Alexander,

Could you take over this one from Marcos?
Comment 11 developers 2015-10-08 20:45:48 UTC
Repeated with latest stable releases (Xamarin Studio/Android) - again no changes to Mono so BCL classes remain unchanged

=== Xamarin Studio ===

Version 5.9.7 (build 22)
Installation UUID: a4abed14-a47b-4589-9f0e-8a7f068e0747
Runtime:
	Mono 4.0.4 ((detached/d481017)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400040004

=== Apple Developer Tools ===

Xcode 7.0.1 (8228)
Build 7A1001

=== Xamarin.iOS ===

Version: 9.0.1.29 (Business Edition)
Hash: 1d27ac2
Branch: master
Build date: 2015-09-25 18:08:44-0400

=== Xamarin.Android ===

Version: 5.1.7.12 (Business Edition)
Android SDK: /VE4D/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Not Installed

=== Xamarin.Mac ===

Version: 2.0.2.111 (Starter Edition)

=== Build Information ===

Release ID: 509070022
Git revision: 6bd1f169df44ca96addf8a035316c535a4fa46fa
Build date: 2015-09-30 12:30:15-04
Xamarin addins: 1c3e5c0859bdfec0ecd481a57ad6c03bc22f5536

=== Operating System ===

Mac OS X 10.10.5
Darwin 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Comment 12 developers 2015-10-14 01:17:22 UTC
Are you able to let me know if you require any further information?

Unfortunately, in a data-driven application (which is largely date-based) being unable to apply Predicate searches with dates is a blocker for us.
Comment 13 Alexander Köplinger [MSFT] 2015-10-14 09:38:42 UTC
Hi, I've been able to reproduce this. Thanks for your sample project, it was very helpful.

I'm looking into a fix now.
Comment 14 developers 2015-10-14 09:44:06 UTC
Hi Alexander,

Thank you kindly for looking into the issue. Please let me know if you need any further information.
Comment 15 Alexander Köplinger [MSFT] 2015-10-14 15:33:06 UTC
This pull request fixes the NotImplementedException issue in my testing: https://github.com/mono/mono/pull/2134.
Comment 16 developers 2015-10-14 18:48:50 UTC
Hi Alexander,

Are you able to confirm if this also resolves the Date compare? Based on the pull request, it only mentions string compare against null. 

var predicate = PredicateBuilder.Create<CustomDataType>(x => true);
predicate = predicate.And (x => x.NextDueDate > DateTime.Today.AddDays(0 -
int.Parse("5")));
var predicateCompiled = predicate.Compile();

Error:
System.NotImplementedException: Interpreter of ref types
Comment 17 Alexander Köplinger [MSFT] 2015-10-15 08:56:47 UTC
No, it doesn't fix the "Interpreter of ref types" issue. That one is a bit harder since this normally requires JITing which isn't available when using the LINQ expression interpreter on iOS. We should be able to handle these special cases though.
Comment 18 Alexander Köplinger [MSFT] 2015-10-15 08:59:48 UTC
To make sure I understand correctly: that exact code worked on the previous release so it's a regression?
Comment 19 developers 2015-10-15 09:20:46 UTC
Hi Alexander,

The code in the sample is a variation, but yes the two (String and Date) both worked previously.

The following code was implemented on 1/9/15 with the latest Xamarin Stable (running iOS8 SDK/ Xcode 6.4):

predicate = predicate.And (x => x.NextDueDate < DateTime.Today.AddDays(0 - int.Parse(presWindowBefore.Value)) && (x.PendingAuthPersonName == null || x.PendingAuthPersonName == string.Empty));

predicate = predicate.And (x => x.NextDueDate > DateTime.Today.AddDays(    int.Parse(presWindowAfter.Value))  && (x.PendingAuthPersonName == null || x.PendingAuthPersonName == string.Empty));

We complied the project (with the code above) on 14/9/15 and was sent to the AppStore and is currently live on the previous build.

We then continued with development from 28/9/15, running the latest stable Xamarin and xCode 7.
Comment 20 Alexander Köplinger [MSFT] 2015-10-22 13:37:02 UTC
I've fixed the second part and the fix is already in Mono master.

I'll make sure it gets into the next service release (it's too late for the upcoming stable release as that was freezed a while ago). Thanks for the bug report!
Comment 21 Alexander Köplinger [MSFT] 2015-10-27 11:21:41 UTC
It was decided that the fixes will be put into the upcoming stable release (instead of the service release after it as initially planned).
Comment 22 Shruti 2015-10-28 07:54:00 UTC
******************************************************
Reproduce Status
******************************************************
I have reproduced this issue using attached project on Xamarin.iOS 9.1.0.18 
Screencast: http://www.screencast.com/t/JcFh8vcxH

******************************************************
Verify Status : Introduce another bug
******************************************************
I have checked this issue with build provided link in trello card monotouch-9.3.0.311 and did not get the crash for which this issue has been filed but observed an another exception "Unhandled managed exception: Objective-C exception thrown.  Name: NSInternalInconsistencyException Reason: Application windows are expected to have a root view controller at the end of application launch" . A bug is already reported and verified for this issue https://bugzilla.xamarin.com/show_bug.cgi?id=35159. 

I am reopening this issue because not able to verify this issue due to another issue. Feel free to change the status as per your observation.
Comment 23 Sebastien Pouliot 2015-10-28 08:38:36 UTC
@Alexander "upcoming stable release" is not very clear, e.g. the iOS 9.1 support will become stable before C6 (which you're likely talking about). More precision (or a link to the trello card on the release board) will avoid confusion.

@Shruti the other issue is unrelated, newer iOS releases requires application to set the rootViewController (but that was optional in older version) in the FinishedLaunching method. The sample code will need to be adjusted, just add the line:

>	Window.RootViewController = new UIViewController ();

before:

>	Window.MakeKeyAndVisible ();
Comment 24 Shruti 2015-10-28 08:46:45 UTC
Update to comment (22):- 

I apologize for typo mistake in comment(22)  >>Verify Status. 
I have checked it with monotouch-9.2.0.97, not 9.3.0.311. 
Screencast for the same: http://www.screencast.com/t/CF1OfrpM2evi
Application output: https://gist.github.com/shrutis360/67d570362031183831c3
Symbolicated Logs: https://gist.github.com/shrutis360/5d94a63fb49b9109a39d
Comment 25 Alexander Köplinger [MSFT] 2015-10-28 08:49:52 UTC
@Sebastian: thanks. Yes, I was talking about C6 (trello card for the bug: https://trello.com/c/XmePw9s5/377-xi-bug-34334). I'm still getting up to speed with all the product milestones :)
Comment 26 Shruti 2015-10-28 08:59:30 UTC
Thanks @Sebastien, I am able to deploy and launch the application on device after changes as suggested in comment(23) using monotouch-9.2.0.97.
Screencast: http://www.screencast.com/t/QGuilAl5eFc
Environment Info: https://gist.github.com/shrutis360/2e564bbef44a732d04f7

Changed the Status from Reopen to Resolved.
Comment 27 Shruti 2015-10-30 03:29:59 UTC
This issue is working fine on C6 monotouch-9.2.1.21_9ce9e8b98427671bb17a5c5ba2263f15b28216bc.
Screencast:http://www.screencast.com/t/tfpQvXwxb
Environment Info: https://gist.github.com/shrutis360/be9efe96b5db7d494265


Hence, Closing this issue.