Skip to content

Conversation

@jhavrane
Copy link
Contributor

@jhavrane jhavrane commented Dec 9, 2025

Fix #5443. Added test itself doesn't verify the new message in TypeInference, but ConstantFolding instead (which was missing a test until now).

@jhavrane jhavrane self-assigned this Dec 9, 2025
@jhavrane
Copy link
Contributor Author

jhavrane commented Dec 9, 2025

Compiler output when ConstantFolding pass is commented out in frontend:

 issue5443.p4(8): [--Werror=type-error] error: '~' operation cannot be applied to an operand '0x100' with an unknown width
         if (~0x100) {
              ^^^^^
 issue5443.p4(8): [--Werror=invalid] error: ~0x100: Operation cannot be applied to values with unknown width;
 please specify width explicitly
         if (~0x100) {
             ^^^^^^
 issue5443.p4(8): [--Werror=type-error] error: '~' operation cannot be applied to an operand '0x100' with an unknown width
         if (~0x100) {
              ^^^^^
 issue5443.p4(8): [--Werror=type-error] error: Error while analyzing ~0x100
         if (~0x100) {
             ^^^^^^

@fruffy fruffy added the core Topics concerning the core segments of the compiler (frontend, midend, parser) label Dec 10, 2025
Signed-off-by: Jiri Havranek <[email protected]>
@fruffy fruffy added this pull request to the merge queue Dec 15, 2025
@fruffy fruffy removed this pull request from the merge queue due to a manual request Dec 15, 2025
@jhavrane jhavrane added this pull request to the merge queue Dec 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Topics concerning the core segments of the compiler (frontend, midend, parser)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

boost::too_few_args thrown when reporting error in TypeInference

2 participants