Skip to content

Commit 8a72624

Browse files
committed
Guid? need special handling, cause we have multiple matching Methods in line 82-87
1 parent 7ade89e commit 8a72624

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/System.Linq.Dynamic.Core/ExpressionParser.cs

+8-5
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,8 @@ interface IEqualitySignatures : IRelationalSignatures
8383
void F(Guid? x, Guid? y);
8484
void F(Guid x, string y);
8585
void F(Guid? x, string y);
86-
void F(Guid x, object y);
87-
void F(Guid? x, object y);
8886
void F(string x, Guid y);
8987
void F(string x, Guid? y);
90-
void F(object x, Guid y);
91-
void F(object x, Guid? y);
9288
}
9389

9490
interface IAddSignatures : IArithmeticSignatures
@@ -1830,7 +1826,9 @@ void CheckAndPromoteOperands(Type signatures, string opName, ref Expression left
18301826

18311827
MethodBase method;
18321828
if (FindMethod(signatures, "F", false, args, out method) != 1)
1833-
throw IncompatibleOperandsError(opName, left, right, errorPos);
1829+
{
1830+
throw IncompatibleOperandsError(opName, left, right, errorPos);
1831+
}
18341832

18351833
left = args[0];
18361834
right = args[1];
@@ -1973,6 +1971,11 @@ int FindBestMethod(IEnumerable<MethodBase> methods, Expression[] args, out Metho
19731971
{
19741972
applicable = applicable.Where(m => applicable.All(n => m == n || IsBetterThan(args, m, n))).ToArray();
19751973
}
1974+
1975+
if (args.Length == 2 && applicable.Length > 1 && (args[0].Type == typeof(Guid?) || args[1].Type == typeof(Guid?)))
1976+
{
1977+
applicable = applicable.Take(1).ToArray();
1978+
}
19761979

19771980
if (applicable.Length == 1)
19781981
{

0 commit comments

Comments
 (0)