-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed merge for substitutions (#138)
* Added failing test * Make substitution to use deep copy + fixed deep clone for some types * NRE fix * Fixed deep clone to take substitutions into account
- Loading branch information
1 parent
6d14466
commit c386b2e
Showing
6 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace Hocon.Extensions | ||
{ | ||
/// <summary> | ||
/// HoconElementExtensions | ||
/// </summary> | ||
public static class HoconElementExtensions | ||
{ | ||
/// <summary> | ||
/// Performs deep clone of the element's value. | ||
/// This is generally the same as <see cref="IHoconElement.Clone"/>, but | ||
/// for substitutions it returns the substitution itself since it's value will be closed | ||
/// during resolution process. | ||
/// </summary> | ||
public static IHoconElement CloneValue(this IHoconElement hoconElement, IHoconElement newParent) | ||
{ | ||
return hoconElement is HoconSubstitution ? hoconElement : hoconElement.Clone(newParent); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters