Skip to content

Commit

Permalink
Make argless StaticArray.new private. Fixes #3308
Browse files Browse the repository at this point in the history
Ary Borenszweig committed Sep 14, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 803a20f commit 11c7050
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/static_array.cr
Original file line number Diff line number Diff line change
@@ -47,6 +47,12 @@ struct StaticArray(T, N)
new { value }
end

# Disallow creating an uninitialized StaticArray with new.
# If this is desired, one can use `array = uninitialized ...`
# which makes it clear that it's unsafe.
private def initialize
end

# Equality. Returns *true* if each element in `self` is equal to each
# corresponding element in *other*.
#

0 comments on commit 11c7050

Please sign in to comment.