Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
PUP 4.4.0
-
None
-
None
-
1
-
Language 2016-04-20
-
Bug Fix
-
if an attempt was made to call a function (e.g. notice) with the result of a call to a function that produces an Iterator (e.g. reverse_each) the operation would fail. Now the iterator is transformed to an array in those cases.
Description
The following manifest:
notice([1,2,3].reverse_each)
|
results in:
Error: Evaluation Error: Error while evaluating a Function Call, undefined local variable or method `mod_types' for #<Puppet::Pops::Types::PVariantType:0x007fdcee20ae68> at /Users/peterhuene/.puppetlabs/etc/code/environments/production/manifests/site.pp:1:1 on node peterhu-osx
|
This should obviously not produce an error.
Personally, I'd expect an iterator to display an array representation of the iteration sequence unless it's iterating over a hash, which should probably be represented as a hash.
Thus the expected output would be:
Notice: Scope(Class[main]): [3, 2, 1]
|
The native compiler has decided that the output of an iterator displays an array/hash of the sequence without actually constructing one.
ACCEPTANCE CRITERIA
notice([1,2,3].reverse_each)
|
Should notice
[3, 2, 1]
|
Attachments
Issue Links
- relates to
-
PUP-6151 Output of iterator type emits 'value' text after type
-
- Closed
-