-
Notifications
You must be signed in to change notification settings - Fork 832
Closed
Labels
Area-QueriesQuery expressions and library implementationQuery expressions and library implementationBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Description
I'm trying to have an expression tree to compare a struct with the same item, and it fails?
open System
open System.Linq.Expressions
//let tester = Some "a" //works
//let tester = Guid.NewGuid() //works
let tester = ValueSome "b" //crash
let equalExpr = Expression.Equal(Expression.Constant(tester), Expression.Constant(tester))
//System.InvalidOperationException: The binary operator Equal is not defined for the types
// 'Microsoft.FSharp.Core.FSharpValueOption`1[System.String]' and
// 'Microsoft.FSharp.Core.FSharpValueOption`1[System.String]'.
// at System.Linq.Expressions.Expression.GetEqualityComparisonOperator(ExpressionType binaryType, String opName, Expression left, Expression right, Boolean liftToNull)
// at System.Linq.Expressions.Expression.Equal(Expression left, Expression right, Boolean liftToNull, MethodInfo method)Metadata
Metadata
Assignees
Labels
Area-QueriesQuery expressions and library implementationQuery expressions and library implementationBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Type
Projects
Status
Done