Open
Conversation
…tance (E125) Add polymorphism-aware validation for POINTER TO assignments involving classes and function blocks. The compiler now checks that pointee types are related via EXTENDS, catching unrelated types, invalid downcasts, and sibling assignments. - Add E125 error code for incompatible polymorphic pointer assignments - Validate both pointer-to-pointer (ptrA := ptrB) and ADR cases (ptr := ADR(instance)) - Validate call arguments passed as POINTER TO parameters - Update E015 docs to reflect that class/FB pointers are now validated - Add 24 tests covering valid upcasts, invalid downcasts, unrelated/sibling types, and call argument variants
d464617 to
52d61a2
Compare
…l arguments (E126) Add polymorphism-aware validation for interface-typed assignments and call arguments. The compiler now checks that POU-to-interface assignments satisfy IMPLEMENTS, and interface-to-interface assignments are valid upcasts. These checks run during lowering (before interface types are rewritten to __FATPOINTER) to preserve user-facing type names in errors. - Add E126 error code for incompatible interface polymorphism - Add validation module in dispatch lowerer with two check functions - Validate POU-to-interface assignments (POU must implement interface) - Validate interface-to-interface assignments (must be same or upcast) - Validate call arguments passed as interface-typed parameters - Surface lowerer diagnostics through PipelineParticipantMut trait - Drop/replace invalid nodes to prevent cascading __FATPOINTER errors - Add 26 tests covering valid upcasts, invalid downcasts, unrelated types, call argument variants, method existence, and field access
52d61a2 to
c1c3806
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces validations for polymorphism, blocked by #1629