aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2020-11-12 11:15:53 +0100
committerPatrick Spek <p.spek@tyil.nl>2020-11-12 11:15:53 +0100
commit9205fb48a747edc14bbac9e70646cec93891c97c (patch)
tree95ce18e4e27f1039665f07beb3c4510047b8ef88
parentcb947f141e4478c67c1ff679e89902a0f7572a75 (diff)
.clone the data hash
-rw-r--r--CHANGELOG.md8
-rw-r--r--lib/Config.rakumod2
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9874325..dc7ff5c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic
Versioning](http://semver.org/spec/v2.0.0.html).
+## [Unreleased]
+
+### Changed
+
+- `.read` now uses `%!data.clone`, instead of `%!data`. This should fix an
+ issue where the `Hash` used is shared between the objects, resulting in
+ hard-to-debug errors.
+
## [3.0.0] - 2020-07-12
`Config` has been rebuilt from the ground up. This is a relatively old
diff --git a/lib/Config.rakumod b/lib/Config.rakumod
index f85774a..2d33b71 100644
--- a/lib/Config.rakumod
+++ b/lib/Config.rakumod
@@ -149,7 +149,7 @@ multi method read (
Config.new(
%!template,
:$!name,
- data => merge-hash(%!data, %data),
+ data => merge-hash(%!data.clone, %data),
:!read-from-env,
:!read-from-xdg,
)