Skip to content
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

Validation of invalid assigment (Type-Incompatibility - e.g. assign STRING to DINT) #726

Closed
Tracked by #737
mhasel opened this issue Jan 5, 2023 · 3 comments
Closed
Tracked by #737
Assignees
Labels
good first issue Good for newcomers validation candidate for syntactic or semantic validation

Comments

@mhasel
Copy link
Member

mhasel commented Jan 5, 2023

The following code snippet does not result in a validation error, even though it should:

PROGRAM FOO
  VAR
    x : DINT;
    s : STRING;
  END_VAR
    s := 'Hello, world!';
    x := s;
END_PROGRAM

We already have validations in place for invalid assignments, but as far as i can tell this validation only happens for either call parameters of when trying to assign characters. We should extend the validation to also cover other possibilities, otherwise the attempted codegen will result in a panic.

@mhasel mhasel added the validation candidate for syntactic or semantic validation label Jan 5, 2023
@ghaith ghaith added the good first issue Good for newcomers label Jan 9, 2023
@99NIMI 99NIMI mentioned this issue Jan 26, 2023
5 tasks
@mhasel mhasel self-assigned this Feb 8, 2023
@riederm riederm changed the title Missing invalid assigment validation Validation of invalid assigment (Type-Incompatibility - e.g. assign STRING to DINT) Feb 14, 2023
@mhasel mhasel linked a pull request Feb 21, 2023 that will close this issue
@99NIMI
Copy link
Contributor

99NIMI commented Feb 28, 2023

should be fixed with #780

@mhasel
Copy link
Member Author

mhasel commented Mar 6, 2023

fixed with #780

1 similar comment
@mhasel
Copy link
Member Author

mhasel commented Mar 6, 2023

fixed with #780

@mhasel mhasel closed this as completed Mar 6, 2023
@mhasel mhasel closed this as completed Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers validation candidate for syntactic or semantic validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants