config icon indicating copy to clipboard operation
config copied to clipboard

Substitution issue with arrays

Open laurentgo opened this issue 4 years ago • 1 comments

This is similar to #177 but instead of adding elements one by one like in the following example:

d { x = [] }, c : ${d}, c { x : ${c.x}[1], x : ${c.x}[2] }

elements are added as one single array:

d { x = [] }, c : ${d}, c { x : ${c.x}[1, 2] }

The config just above fails when being resolved with the following exception:

com.typesafe.config.ConfigException$UnresolvedSubstitution: test string: 1: Could not resolve substitution to a value: ${c.x} was part of a cycle of substitutions involving ${c.x}, ${c.x}

laurentgo avatar Apr 22 '21 21:04 laurentgo

Sorry if it has been reported already? I did check the list of open issues but didn't find one similar to this one.

During debugging, the main difference I found was that the initial config created an extra ConfigDelayedMergeObject instance around the 2 concatenations, which I guess helps with the resolution.

laurentgo avatar Apr 22 '21 21:04 laurentgo