Skip to content

Commit

Permalink
fix: include a fix for Hash dup issues
Browse files Browse the repository at this point in the history
caused by generics inheritance
  • Loading branch information
stakach committed Feb 1, 2021
1 parent 3149988 commit ec28213
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: placeos-driver
version: 4.0.0
version: 4.0.1

dependencies:
action-controller:
Expand Down
11 changes: 11 additions & 0 deletions src/placeos-driver/storage.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,15 @@ abstract class PlaceOS::Driver::Storage < Hash(String, String)
abstract def signal_status(status_name) : String?
end

# Fix for a Hash dup issues on crystal 0.36.0
{% if compare_versions(Crystal::VERSION, "0.36.0") == 0 %}
class Hash(K, V)
def dup
hash = Hash(K, V).new
hash.initialize_dup(self)
hash
end
end
{% end %}

require "./storage/redis-storage"

0 comments on commit ec28213

Please sign in to comment.