-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
!isimmutable("abc") && !isimmutable(:abc) #30210
Comments
So I tried this naive patch, but this results in a segfault during diff --git a/src/jltypes.c b/src/jltypes.c
index e89f552afa..8ca60d6658 100644
--- a/src/jltypes.c
+++ b/src/jltypes.c
@@ -2162,7 +2162,7 @@ void jl_init_types(void) JL_GC_DISABLED
jl_abstractstring_type = jl_new_abstracttype((jl_value_t*)jl_symbol("AbstractString"), core, jl_any_type, jl_emptysvec);
jl_string_type = jl_new_datatype(jl_symbol("String"), core, jl_abstractstring_type, jl_emptysvec,
- jl_emptysvec, jl_emptysvec, 0, 1, 0);
+ jl_emptysvec, jl_emptysvec, 0, 0, 0);
jl_string_type->instance = NULL;
jl_compute_field_offsets(jl_string_type);
This is the segfault; it reliably goes away if I undo the patch, and comes back if I re-apply it:
|
The most obvious modification would be a subset of
That is, make them immutable non-structs in But then, one would need to check whether we want this: Do we e.g. want to permit finalizers on String and Symbol? Currently they are permitted. I'd guess that object identity should respect finalizers, so that is a point in favor of |
dup |
That issue on symbols makes some sense to me -- though it would be great if this was part of the documentation, as I'd never have guessed this reasoning (which is to say, it would be helpful if one could learn about it from the manual, and thus learn quite a lot beyond it, too). |
This is because our struct model is not yet able to express the layout of |
related #43229 Can we just clarify in documentation the technical reason behind the output and close out this issue? |
If the |
Since #22193 and #22954
String
s are supposed to be immutable, yet:Similarly,
Symbol
s have been immutable and===
-comparable for ever and yet:Pointed out by @fingofin on discourse. Also potentially of interest:
The text was updated successfully, but these errors were encountered: