Closed cllns closed 2 years ago
Another fun enhancement to this would be to store a @_freeze_caller = caller
when freezing it, then surface it when this error occurs, telling users where they froze the container.
Rebased on master to resolve conflicts
Before:
After:
That a
Dry::Container
is implemented withConcurrent::Hash
is an implemention detail. I think wrapping it helps users of the library see that this is an expected exception, rather than an error within the library. And the text in the parentheses should help users when they encounter this error.I also split up the specs and removed a conditional for whether Ruby is 2.5+, since this gem only supports 2.5+ now.
(Relevant commit where
.freeze
was implemented: https://github.com/dry-rb/dry-container/commit/6fc5cd2650b1888ac6f4fc56592878695d296979)