rusty icon indicating copy to clipboard operation
rusty copied to clipboard

Alias declaration with invalid type panics on an `unwrap`

Open mhasel opened this issue 1 year ago • 0 comments

Describe the bug The following example will hit an unwrap in https://github.com/PLC-lang/rusty/blob/bca3c3179ea8752093e3b8654226fbc646b69a6f/src/validation/variable.rs#L246-L251 when the declared type does not exist.

To Reproduce try to compile with --check:

VAR_GLOBAL 
    y: BOOL;
END_VAR

FUNCTION main 
VAR
    x AT y : SomeUndefinedType;
END_VAR

END_FUNCTION

Expected behavior A diagnostic with Unknown type: SomeUndefinedType

mhasel avatar Sep 10 '24 12:09 mhasel