-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simplify undef
-taking constructors
#96
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #96 +/- ##
==========================================
- Coverage 96.00% 95.96% -0.04%
==========================================
Files 3 3
Lines 250 248 -2
==========================================
- Hits 240 238 -2
Misses 10 10 ☔ View full report in Codecov by Sentry. |
The context is that a future PR will consider adding a fourth type parameter to |
The code coverage misses are the same false positives as in #88, becase of moving the code around. |
Prevent an exponential increase in the number of these constructor methods in case `FixedSizeArray` gets more type parameters.
1de7f6e
to
64a2d2b
Compare
function FixedSizeArray{T,N,V}(::UndefInitializer, size::Vararg{Integer,N}) where {T,N,V} | ||
FixedSizeArray{T,N,V}(undef, size) | ||
function parent_type_with_default(::Type{<:FixedSizeArray}) | ||
default_underlying_storage_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not concrete, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That particular method shouldn't ever be called here, it's used in collect_as.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the parent_type_with_default
methods were moved from collect_as.jl to this file in the first commit, to be shared between files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return size
from check_ndims
Prevent doubling in the number of these constructor methods with each additional
FixedSizeArray
type parameter.I think the code is nicer, too.