[PUP-4511] Types Array[?], Hash[?,?], and Optional[?] are not assignable to themselves Created: 2015/05/01  Updated: 2015/05/20  Resolved: 2015/05/20

Status: Closed
Project: Puppet
Component/s: None
Affects Version/s: None
Fix Version/s: PUP 3.8.1, PUP 4.1.0

Type: Bug Priority: Normal
Reporter: Thomas Hallgren Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks PUP-4483 Add NotUndef type to the set of Puppe... Closed
Template:
Story Points: 1
Sprint: Language 2015-05-13

 Description   

The TypeCalculator.assignable? method does not consider the types Array[?], Hash[?,?], and Optional[?] to be assignable to themselves.

This is an internal fix. The problem can not be reproduced from Puppet. The only way to reproduce the problem is to use internal Ruby methods.

QA


risk: low
probability: low
severity: low
test level: unit



 Comments   
Comment by Henrik Lindberg [ 2015/05/04 ]

merged to 3.x at: 761ccb5

Comment by Eric Thompson [ 2015/05/06 ]

any tips on how to reproduce this? i'm missing how this is useful

[root@i2n12lxkwc9dgzw puppet]# puppet apply -e '$x = Array[Integer] $x = [1,2]' --parser future
Error: Evaluation Error: Cannot reassign variable x  at line 1:24 on node i2n12lxkwc9dgzw.delivery.puppetlabs.net
Error: Evaluation Error: Cannot reassign variable x  at line 1:24 on node i2n12lxkwc9dgzw.delivery.puppetlabs.net
[root@i2n12lxkwc9dgzw puppet]# puppet apply -e 'Array[Integer] = [1,2]' --parser future
Error: Could not parse for environment production: Illegal attempt to assign via [index/key]. Not an assignable reference  at line 1:1 on node i2n12lxkwc9dgzw.delivery.puppetlabs.net
Error: Could not parse for environment production: Illegal attempt to assign via [index/key]. Not an assignable reference  at line 1:1 on node i2n12lxkwc9dgzw.delivery.puppetlabs.net

Comment by Thomas Hallgren [ 2015/05/06 ]

I tried this and it's actually not possible to reproduce from Puppet. The parser converts Array to Array[Data], Hash to Hash[Scalar,Data] and Optional to Optional[Undef] so the problem with missing contained types never surfaces in Puppet. It can only occur when the types are created from Ruby.

Comment by Nicholas Fagerlund [ 2015/05/14 ]

This ticket doesn't describe the significance of the bug. Could someone please update the description with whether this is an internal-only fix, or whether it affects extension APIs?

Comment by Henrik Lindberg [ 2015/05/14 ]

This is an internal only fix

Generated at Fri Oct 18 22:05:30 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.