Skip to content

Unary expression + <REAL> panics on unimplemented!() #1171

Open
@mhasel

Description

@mhasel

Describe the bug
Unary expressions with an explicit + operator on REALs will panic in


The same expression with INTs is fine.

To Reproduce
This came up while porting a project and the MRE boils down to this:

FUNCTION main: DINT
VAR
    r: REAL;
    i: INT;
END_VAR
    i := + 6; // this is fine
    r := + r; // hits `unimplemented!()` in `expression_generator.rs:400`
    r := + 6.0; // same as above
END_FUNCTION

Expected behavior
the expression + 6.0 behaving just like 6.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions