-
Notifications
You must be signed in to change notification settings - Fork 55
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
fix: Bitaccess for VAR_OUTPUT #1214
Conversation
a644e19
to
e139df7
Compare
fn arguments_are_implicit(arguments: &[&AstNode]) -> bool { | ||
!arguments.iter().any(|argument| argument.is_assignment() || argument.is_output_assignment()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be problematic for #668, if we decide to allow it. Personally I am tending towards won't fix
on that one, so not a show-stopper for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a comment referencing #668
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the solution of redirecting from the statement generator! Just have some open questions.
// TODO: Can we this be simplified? | ||
let rhs_type = { | ||
let pou = self.index.find_pou(function_name).unwrap(); | ||
let pou_struct = &pou.find_instance_struct_type(self.index).unwrap().information; | ||
let DataTypeInformation::Struct { members, .. } = pou_struct else { panic!() }; | ||
|
||
self.index.find_effective_type_by_name(&members[index as usize].data_type_name).unwrap() | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are all these unwrap
s/panic
s intended or are they left over from prototyping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intended, because I'd argue these have to exist at codegen and otherwise expose a bug in our resolver / validator. Should I introduce a top-level comment / use expect
to make it more transparent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the unwraps, I think these are just a matter of taste. I would change the panic
into an unreachable
if you want to convey that this branch is impossible to hit, otherwise make it a diagnostic.
…into output-bitaccess
…into output-bitaccess
Resolves #1176