Skip to content

fix: ensuring a validation error is raised when output assignment will result in a LLVM error#1618

Open
Angus-Bethke-Bachmann wants to merge 10 commits intomasterfrom
anbt/PRG-3021
Open

fix: ensuring a validation error is raised when output assignment will result in a LLVM error#1618
Angus-Bethke-Bachmann wants to merge 10 commits intomasterfrom
anbt/PRG-3021

Conversation

@Angus-Bethke-Bachmann
Copy link
Contributor

Changed

  • Ensuring a validation error is raised when output assignment will result in a LLVM error

Testing

  • Updated existing snapshot to include error

libFunction(
inVar1 := 0,
inVar2 := 0.0,
result => i1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this should definitely work, no? This feels more like a codegen bug rather than a missing validation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well in this case I compared to CODESYS, and they just flat-out refuse to type-cast:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe codesys in general refuses implicit type casts, they're much stricter in that context than we are. Still, this feels like a codegen bug to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After chatting with @ghaith yesterday, we decided to fix this with lowering. The necessary lowering has been added to perform the casting. In addition to this, I have removed the new error code, but it will still log the warning that implicit downcasting will occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants