Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
HertzDevil committed Oct 16, 2023
1 parent 79521c9 commit 7f72525
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/box.cr
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class Box(T)
# specify T: `Box(T).unbox(data)`.
#
# WARNING: It is undefined behavior to box an object in one type and unbox it
# via a different type; in particular, when boxing a `T` as a `T?`, or
# vice-versa.
# via a different type; in particular, when boxing a `T` and unboxing it as a
# `T?`, or vice-versa.
def self.unbox(pointer : Void*) : T
{% if T.union_types.all? { |t| t == Nil || t < Reference } %}
pointer.as(T)
Expand Down

0 comments on commit 7f72525

Please sign in to comment.