PLC-lang/rusty

using `__VOID` as a type in user code should be an error

开放

#1,348 创建于 2024年10月24日

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

仓库指标

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

描述

We currently do not have a validation in place to safeguard against initializing a variable with __VOID. Since the void type does not exist outside of return-types in LLVM, the variable's type is then changed to i32 during codegen. I think it would make sense to disallow using the type in user code in general, especially seeing as it is prefixed with __.

FUNCTION_BLOCK foo
VAR
    x : __VOID;
END_VAR
END_FUNCTION_BLOCK

...

%foo = type { i32 }

贡献者指南