Skip to content

Merge 8.5.1 back to main #9289

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

Merged
merged 7 commits into from
Mar 12, 2024
Merged

Conversation

joshcooper
Copy link
Contributor

No description provided.

joshcooper and others added 7 commits February 29, 2024 10:54
Previously, class parameters of the form `Integer[-1] $param` would fail
compilation, because the value `-1` was lexed as a UnaryMinusExpression
containing a LiteralInteger. And since the LiteralEvaluator didn't implement the
`literal_UnaryMinusExpression` method, the visitor called `literal_XXX` for each
ancestor class, until reaching `literal_Object`, which always raises.

This adds the `literal_UnaryMinusExpression` method and returns -1 times
the expression it wraps. This is similar to how the TypeParser interprets
UnaryMinusExpressions[1].

[1] https://github.com/puppetlabs/puppet/blob/8.5.0/lib/puppet/pops/types/type_parser.rb#L161
If strict is off, the issue will be ignored. If strict is warning, then a
warning will be reported, but compilation will continue:

    Warning: The parameter '$i' must be a literal type, not a Puppet::Pops::Model::AccessExpression

If strict is error, then compilation will fail.
The "undef to nil" test is special because otherwise the value nil when
interpolated in the name of the test results in empty string.
(packaging) Bump to version '8.5.1' [no-promote]
"8.5.1"

* tag '8.5.1':
  (packaging) Bump to version '8.5.1' [no-promote]
  Add additional literal evaluator tests
  Allow non-literal parameter type issue to be controlled by strict
  Accept UnaryMinusExpression as class parameter type
@mhashizume mhashizume merged commit 12cc9e6 into puppetlabs:main Mar 12, 2024
@mhashizume mhashizume added the maintenance Maintenance chores are excluded from changelogs label Mar 12, 2024
@joshcooper joshcooper deleted the mergeback_851 branch October 10, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance chores are excluded from changelogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants