string fix
This commit is contained in:
@@ -358,13 +358,13 @@ public sealed class TypeChecker
|
||||
case BinaryOperatorSyntax.Plus:
|
||||
{
|
||||
var left = CheckExpression(expression.Left);
|
||||
if (left.Type is IntTypeNode or FloatTypeNode or StringTypeNode or StringTypeNode)
|
||||
if (left.Type is IntTypeNode or FloatTypeNode or StringTypeNode or CStringTypeNode)
|
||||
{
|
||||
var right = CheckExpression(expression.Right, left.Type);
|
||||
return new BinaryExpressionNode(left.Type, left, op, right);
|
||||
}
|
||||
|
||||
throw new TypeCheckerException(Diagnostic.Error("The plus operator must be used with int, float or string types").At(expression.Left).Build());
|
||||
throw new TypeCheckerException(Diagnostic.Error("The plus operator must be used with int, float, cstring or string types").At(expression.Left).Build());
|
||||
}
|
||||
case BinaryOperatorSyntax.Minus:
|
||||
case BinaryOperatorSyntax.Multiply:
|
||||
|
||||
Reference in New Issue
Block a user