-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fix #53 with ismutable default #67
Conversation
Default behavior is to use the `mutable` field of a type
I'm not sure we should do this. It's almost guaranteed to not be correct for wrapper types. |
It doesn't change any of the current behavior for wrapper types. It simply provides a fall back. If we want to account for wrappers I could replace the current function ismutable(::Type{T}) where {T}
if parent_type(T) <: T
return T.mutable
else
return ismutable(parent_type(T))
end
end ...and then we could explicitly define the mutability of each type. |
I added the recursive version that searches for a parent structure. I still haven't changed any of the tests, because the behavior is essentially the same. |
@ChrisRackauckas, is this PR still problematic? |
I think that works. |
Could it get a test? Fake wrapper |
So instead of testing a fake wrapped array I just tested views of StaticArrays. Turns out this actually fixes views on immutable arrays (which previously just assumed mutability). |
I'm convinced. |
This makes it so that
ismutable
has a default now, which is to use themutable
field of a type.