PLC-lang/rusty

Add validation for comparison operators

开放

#1,026 创建于 2023年11月23日

 (5 条评论) (0 个反应) (0 位负责人)Rust (71 个派生)auto 404
good first issuemedium-priorityvalidation

仓库指标

星标
 (351 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Is your feature request related to a problem? Please describe. When trying to compile code with a comparison statement which tries to compare incompatible types, we currently do not validate against it and the compilation will fail during codegen.

FUNCTION main : DINT
        VAR
            x1 : ARRAY[0..2] OF TOD;
            x2 : STRING;
        END_VAR
            x1 > x2;  
            GT(x1, x2);
END_FUNCTION

Describe the solution you'd like We should validate if the two types in the binary expression can be compared to each other

贡献者指南