vendored/puppet/lib/puppet/pops/issues.rb in bolt-0.23.0 vs vendored/puppet/lib/puppet/pops/issues.rb in bolt-0.24.0

- old
+ new

@@ -488,9 +488,17 @@ ILLEGAL_DEFINITION_LOCATION = issue :ILLEGAL_DEFINITION_LOCATION, :name, :file do _("Unacceptable location. The name '%{name}' is unacceptable in file '%{file}'") % { name: name, file: file } end + ILLEGAL_TOP_CONSTRUCT_LOCATION = issue :ILLEGAL_TOP_CONSTRUCT_LOCATION do + if semantic.is_a?(Puppet::Pops::Model::NamedDefinition) + _("The %{value} '%{name}' is unacceptable as a top level construct in this location") % { name: semantic.name, value: label(semantic) } + else + _("This %{value} is unacceptable as a top level construct in this location") % { value: label(semantic) } + end + end + CAPTURES_REST_NOT_LAST = hard_issue :CAPTURES_REST_NOT_LAST, :param_name do _("Parameter $%{param} is not last, and has 'captures rest'") % { param: param_name } end CAPTURES_REST_NOT_SUPPORTED = hard_issue :CAPTURES_REST_NOT_SUPPORTED, :container, :param_name do