Skip to content

Commit

Permalink
Fixed Reference#dup not working with private classes. Fixes #3858 . F…
Browse files Browse the repository at this point in the history
…ixes #3878
  • Loading branch information
Ary Borenszweig committed Jan 13, 2017
1 parent 19fd176 commit bea18ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/reference.cr
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class Reference
# but we need to avoid the allocate invocation below
raise "can't dup {{@type}}"
{% else %}
dup = {{@type}}.allocate
dup.as(Void*).copy_from(self.as(Void*), instance_sizeof({{@type}}))
dup = self.class.allocate
dup.as(Void*).copy_from(self.as(Void*), instance_sizeof(self))
dup
{% end %}
end
Expand Down

0 comments on commit bea18ec

Please sign in to comment.