Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving inheritence/overloading #96

Closed
luben opened this issue Sep 26, 2017 · 2 comments
Closed

Resolving inheritence/overloading #96

luben opened this issue Sep 26, 2017 · 2 comments

Comments

@luben
Copy link
Contributor

luben commented Sep 26, 2017

Continuing with highlighting the differences with typesafe-config.

Given file test-2.conf:

Common {
    common = "common"
}

Foo = ${Common}                                                                                                                                                                                
Foo = {
    home = "/tmp"
    home = ${?HOME}
}

it fails to resolve with "resolve_substitutions() did not give us a resolved object" (it works with typesafe-config).

For the record, this variant does not work in neither of them, though I was expecting it to work:

Common {
    common = "common"
}

Foo = ${Common} {
    home = "/tmp"
    home = ${?HOME}
}

It fails with:

# simple_config_object::replace_child did not find {
    # file: test-2.conf
    # unresolved merge of 2 values follows (
    #     unmerged value 0 from file: test-2.conf
    "home" : "/tmp",
    #     unmerged value 1 from file: test-2.conf
    "home" : ${?HOME}
    # ) end of unresolved merge

}

and

com.typesafe.config.ConfigException$BugOrBroken: SimpleConfigObject.replaceChild did not find SimpleConfigObject({"home":"/tmp","home":${?HOME}}) in SimpleConfigObject({"Common":{"common":"common"},"Foo":${Common}{"home":"/tmp","home":${?HOME}}})

And this variant works in both of them but is more verbose:

Common {
    common = "common"
}

Foo-content {
    home = "/tmp"
    home = ${?HOME}
}
Foo = ${Common} ${Foo-content}
@luben
Copy link
Contributor Author

luben commented Oct 2, 2017

Just another observation, this also does not resolve:

Common {
    common = "common"
}
Foo = ${Common}
Foo = {
    home = "/tmp"
} 

@troizky
Copy link
Contributor

troizky commented May 18, 2018

This pull request will definitely fix the problem #106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants