From 9205fb48a747edc14bbac9e70646cec93891c97c Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Thu, 12 Nov 2020 11:15:53 +0100 Subject: .clone the data hash --- CHANGELOG.md | 8 ++++++++ lib/Config.rakumod | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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, ) -- cgit v1.1