Skip to content

Conversation

@rodiazet
Copy link
Collaborator

@rodiazet rodiazet commented Dec 8, 2025

This PR fixes assignment to a constant variable of a result of string or bytes concatenation, if their arguments are values known in the compile-time.
Closes: #16188

Additionally

  • Add unit tests
  • Update the Changelog.md
  • Update existing unit tests:
    • Modify tests, which trigger "no-effect" expression warning to silence the warning.
    • Update error message, because now they fail in different (but very similar) way.

@rodiazet rodiazet marked this pull request as draft December 8, 2025 12:28
@cameel
Copy link
Collaborator

cameel commented Dec 8, 2025

I think that in addition to positive tests we should also have some negative ones, showing what cannot be used as a constant.

I'd basically create a test covering all the builtins from Units and Globally Available Variables in constant assignments with literal args. Or rather a pair of tests - one for failing ones and one for passing ones, because one failure might hide errors that would happen later in analysis. This would also show if all of them behave as expected - I would not be surprised if it's not just bytes.concat() that's buggy.

@rodiazet rodiazet force-pushed the fix-string-bytes-concat-assigment branch from a09f003 to 9f01f82 Compare December 9, 2025 11:32
@rodiazet
Copy link
Collaborator Author

Moved to #16341

@rodiazet rodiazet closed this Dec 10, 2025
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.

bytes.concat cannot be used for initializating constant

2 participants