Skip to content

Commit

Permalink
Fix .NET35 build
Browse files Browse the repository at this point in the history
  • Loading branch information
StefH committed Mar 2, 2022
1 parent e9ea307 commit 53fd455
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/System.Linq.Dynamic.Core/Parser/ExpressionPromoter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ public virtual Expression Promote(Expression expr, Type type, bool exact, bool c

if (TypeHelper.IsCompatibleWith(expr.Type, type))
{
if (type == typeof(decimal) && expr.Type.IsEnum)
if (type == typeof(decimal) && TypeHelper.IsEnumType(expr.Type))
{
return Expression.Convert(Expression.Convert(expr, Enum.GetUnderlyingType(expr.Type)), type);
}
else if (type.GetTypeInfo().IsValueType || exact || expr.Type.GetTypeInfo().IsValueType && convertExpr)

if (type.GetTypeInfo().IsValueType || exact || expr.Type.GetTypeInfo().IsValueType && convertExpr)
{
return Expression.Convert(expr, type);
}
Expand Down

0 comments on commit 53fd455

Please sign in to comment.