Merged
Conversation
Closed
Sacha0
reviewed
Dec 30, 2020
base/reflection.jl
Outdated
| """ | ||
| ismutabletype(T) -> Bool | ||
|
|
||
| Determine whether type `T` was declared as a struct type |
Member
There was a problem hiding this comment.
struct type -> mutable struct type I think? :)
Sacha0
reviewed
Dec 30, 2020
| This function requires at least Julia 1.7. | ||
| """ | ||
| function ismutabletype(@nospecialize(t::Type)) | ||
| t = unwrap_unionall(t) |
Member
There was a problem hiding this comment.
The similar isstructtype and isprimitivetype definitions below seem to be at-pure; should this definition be as well? :)
Member
Author
There was a problem hiding this comment.
The compiler should be able to prove that itself.
Sacha0
approved these changes
Dec 30, 2020
Member
Sacha0
left a comment
There was a problem hiding this comment.
Looks great modulo the Union conundrum! Thanks Keno! :)
Determines whether a type was declared using `mutable struct`. Naming follows from the `ismutable` query we already have, analogous to `isbits`/`isbitstype`. Replaces #18168.
d07adb1 to
e66ef7f
Compare
ElOceanografo
pushed a commit
to ElOceanografo/julia
that referenced
this pull request
May 4, 2021
Determines whether a type was declared using `mutable struct`. Naming follows from the `ismutable` query we already have, analogous to `isbits`/`isbitstype`. Replaces JuliaLang#18168.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Determines whether a type was declared using
mutable struct.Naming follows from the
ismutablequery we already have, analogousto
isbits/isbitstype. Replaces #18168.