PLC-lang/rusty

Add validation for comparison operators

オープン

#1,026 opened on 2023/11/23

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (71 件のフォーク)auto 404
good first issuemedium-priorityvalidation

Repository metrics

Stars
 (351 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド