Skip to content

Commit 53fd455

Browse files
committed
Fix .NET35 build
1 parent e9ea307 commit 53fd455

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/System.Linq.Dynamic.Core/Parser/ExpressionPromoter.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,12 @@ public virtual Expression Promote(Expression expr, Type type, bool exact, bool c
105105

106106
if (TypeHelper.IsCompatibleWith(expr.Type, type))
107107
{
108-
if (type == typeof(decimal) && expr.Type.IsEnum)
108+
if (type == typeof(decimal) && TypeHelper.IsEnumType(expr.Type))
109109
{
110110
return Expression.Convert(Expression.Convert(expr, Enum.GetUnderlyingType(expr.Type)), type);
111111
}
112-
else if (type.GetTypeInfo().IsValueType || exact || expr.Type.GetTypeInfo().IsValueType && convertExpr)
112+
113+
if (type.GetTypeInfo().IsValueType || exact || expr.Type.GetTypeInfo().IsValueType && convertExpr)
113114
{
114115
return Expression.Convert(expr, type);
115116
}

0 commit comments

Comments
 (0)