You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a layout makes a relative adjustment to a key that does not appear in the last layout specified in extends, the value for that key is left as the string value including the operator (e.g. '+= 100').
For example, the example in the documentation for multiple inheritence will fail because x is a string:
socrates:
x: 100plato:
y: 200aristotle:
extends:
- socrates
- platox: += 50 # evaluates to 250 from plato
lib/ruby/2.4.0/forwardable.rb:229:in `arc': no implicit conversion to float from string (TypeError)
I'm new to Ruby, so I may be reading something wrong, but it looks like recurse_extends merges the current layout with each parent separately (so aristotle/socrates['x'] is 150, aristotle/plato['x'] is '+= 50'), then those are all merged with the later parents taking priority when multiple values exist for the same key. Since aristotle/plato['x'] technically has a value, it overwrites the expected value, so aristotle['x'] == '+= 50'.
The text was updated successfully, but these errors were encountered:
Turns out I never tested this case. I think I've handled it. The docs were also wrong, so I fixed that too. The new docs will be correct once I put out the new release. Expect this fix in v0.14.2
When a layout makes a relative adjustment to a key that does not appear in the last layout specified in
extends
, the value for that key is left as the string value including the operator (e.g.'+= 100'
).For example, the example in the documentation for multiple inheritence will fail because
x
is a string:I'm new to Ruby, so I may be reading something wrong, but it looks like recurse_extends merges the current layout with each parent separately (so
aristotle/socrates['x']
is150
,aristotle/plato['x']
is'+= 50'
), then those are all merged with the later parents taking priority when multiple values exist for the same key. Sincearistotle/plato['x']
technically has a value, it overwrites the expected value, soaristotle['x'] == '+= 50'
.The text was updated successfully, but these errors were encountered: