Skip to content

(PUP-10951) Allow splat operator inside overridden resource collectors #8535

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/puppet/pops/validation/checker4_0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ def check_AttributesOperation(o)
case p
when Model::AbstractResource
when Model::CollectExpression
acceptor.accept(Issues::UNSUPPORTED_OPERATOR_IN_CONTEXT, p, :operator=>'* =>')
else
# protect against just testing a snippet that has no parent, error message will be a bit strange
# but it is not for a real program.
Expand Down
10 changes: 10 additions & 0 deletions spec/integration/parser/collection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,16 @@ class theclass {
MANIFEST
end

it "splats attributes from a hash" do
expect_the_message_to_be(["overridden message"], <<-MANIFEST)
@notify { "testing": message => "original message" }

Notify <| |> {
* => { message => "overridden message" }
}
MANIFEST
end

it "collects with override when inside a class (#10963)" do
expect_the_message_to_be(["overridden message"], <<-MANIFEST)
@notify { "testing": message => "original message" }
Expand Down