Skip to content

Unusual error message when calling ADR on literal numbers #1250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
volsa opened this issue Jun 20, 2024 · 0 comments
Open

Unusual error message when calling ADR on literal numbers #1250

volsa opened this issue Jun 20, 2024 · 0 comments
Labels
bug Something isn't working validation candidate for syntactic or semantic validation

Comments

@volsa
Copy link
Member

volsa commented Jun 20, 2024

Describe the bug

FUNCTION main : DINT
    VAR
        a : REF_TO DINT;
        b : DINT := 5;
    END_VAR

    a = ADR(2.0);
END_FUNCTION

will return

  ┌─ target/demo.st:7:13
  │
7 │     a = ADR(2.0);
  │             ^^^ ()

(same goes for integer values). Returning an error here makes sense, but the error message doesn't. We had something similar here #1176

@volsa volsa added bug Something isn't working validation candidate for syntactic or semantic validation labels Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validation candidate for syntactic or semantic validation
Projects
None yet
Development

No branches or pull requests

1 participant