Fix RCS1061

This commit is contained in:
RoosterDragon
2023-03-18 12:16:52 +00:00
committed by Gustas
parent 5d91b678bb
commit 4dd787be13
32 changed files with 167 additions and 210 deletions

View File

@@ -750,13 +750,11 @@ namespace OpenRA.Support
public void Push(Expression expression, ExpressionType type)
{
expressions.Add(expression);
if (type == ExpressionType.Int)
if (expression.Type != typeof(int))
throw new InvalidOperationException($"Expected System.Int type instead of {expression.Type} for {expression}");
if (type == ExpressionType.Int && expression.Type != typeof(int))
throw new InvalidOperationException($"Expected System.Int type instead of {expression.Type} for {expression}");
if (type == ExpressionType.Bool)
if (expression.Type != typeof(bool))
throw new InvalidOperationException($"Expected System.Boolean type instead of {expression.Type} for {expression}");
if (type == ExpressionType.Bool && expression.Type != typeof(bool))
throw new InvalidOperationException($"Expected System.Boolean type instead of {expression.Type} for {expression}");
types.Add(type);
}