Skip to content

#ref pointing to #ref sometimes works and sometimes it doesn't #112

Open
@zetafish

Description

@zetafish

#ref pointing to other #ref sometimes work and sometimes not

Consider this config.edn

;; config.edn
{:x #or [#ref [:none] "default"] 
 :b #ref [:x]
 :c #ref [:x]
 :d #ref [:x]}

Reading this with aero:

(aero/read-config "config.edn")

I expect that this would return a map like

{:b "default" :c "default" :d "default" :x "defaul"}

but instead I get a map

{:b nil, :d nil, :x default, :c default}

and aero emits warnigns:

WARNING: Unable to resolve "#ref [:x]" at [:b]
WARNING: Unable to resolve "#ref [:x]" at [:d]
WARNING: Unable to resolve "#ref [:none]" at [:x :form 0]

Apparently aero resolves the #ref things in an unspecified order and than you can get lucky or not. Is #ref pointing to #ref something that aero should support?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions