Skip to content

Commit 8b5d2de

Browse files
committed
Corrections Types
1 parent de33aac commit 8b5d2de

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

ExpressionEvaluator.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private enum ExpressionOperator
182182
{ExpressionOperator.Greater, (dynamic left, dynamic right) => left > right },
183183
{ExpressionOperator.LowerOrEqual, (dynamic left, dynamic right) => left <= right },
184184
{ExpressionOperator.GreaterOrEqual, (dynamic left, dynamic right) => left >= right },
185-
{ExpressionOperator.Is, (dynamic left, dynamic right) => (((ClassOrTypeName)right).Type).IsAssignableFrom(left.GetType()) },
185+
{ExpressionOperator.Is, (dynamic left, dynamic right) => ((Type)right).IsAssignableFrom(left.GetType()) },
186186
},
187187
new Dictionary<ExpressionOperator, Func<dynamic, dynamic, object>>()
188188
{
@@ -600,7 +600,7 @@ private bool EvaluateVarOrFunc(string expr, string restOfExpression, Stack<objec
600600

601601
if (staticType != null)
602602
{
603-
stack.Push(new ClassOrTypeName() { Type = staticType });
603+
stack.Push(staticType);
604604
}
605605
else
606606
{
@@ -1045,9 +1045,9 @@ private MethodInfo MakeConcreteMethodIfGeneric(MethodInfo methodInfo)
10451045

10461046
private BindingFlags DetermineInstanceOrStatic(ref Type objType, ref object obj)
10471047
{
1048-
if (obj is ClassOrTypeName classOrTypeName)
1048+
if (obj is Type)
10491049
{
1050-
objType = classOrTypeName.Type;
1050+
objType = obj as Type;
10511051
obj = null;
10521052
return staticBindingFlag;
10531053
}
@@ -1243,11 +1243,6 @@ private string GetCodeUntilEndOfStringInterpolation(string subExpr)
12431243
return result;
12441244
}
12451245

1246-
private class ClassOrTypeName
1247-
{
1248-
public Type Type { get; set; }
1249-
}
1250-
12511246
private class DelegateEncaps
12521247
{
12531248
private lambdaExpressionDelegate lambda;

0 commit comments

Comments
 (0)