From 3ead6631ee293abea37d03b0498782ff925983ef Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Tue, 14 Nov 2023 20:35:27 +0100 Subject: [PATCH 1/3] fix invalidations related to ismutable --- base/reflection.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base/reflection.jl b/base/reflection.jl index 5e32d6e68a58e..f22ba9fde838c 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -627,7 +627,9 @@ true !!! compat "Julia 1.5" This function requires at least Julia 1.5. """ -ismutable(@nospecialize(x)) = (@_total_meta; typeof(x).name.flags & 0x2 == 0x2) +ismutable(@nospecialize(x)) = (@_total_meta; (typeof(x).name::Core.TypeName).flags & 0x2 == 0x2) +# The type assertion above is required to fix some invalidations. +# See also https://github.com/JuliaLang/julia/issues/52134 """ ismutabletype(T) -> Bool From 3f5436c633943ceb0f101022a6b3952e3fb3f3f6 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Wed, 15 Nov 2023 16:35:44 +0100 Subject: [PATCH 2/3] apply suggestion from code review --------- Co-authored-by: Jameson Nash --- base/reflection.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/reflection.jl b/base/reflection.jl index f22ba9fde838c..dc854ed1b8b5e 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -627,7 +627,7 @@ true !!! compat "Julia 1.5" This function requires at least Julia 1.5. """ -ismutable(@nospecialize(x)) = (@_total_meta; (typeof(x).name::Core.TypeName).flags & 0x2 == 0x2) +ismutable(@nospecialize(x)) = (@_total_meta; (inferencebarrier(typeof(x))::DataType).name.flags & 0x2 == 0x2) # The type assertion above is required to fix some invalidations. # See also https://github.com/JuliaLang/julia/issues/52134 From ab6db687526c817e2214f30582a5d3cfbc409130 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Wed, 22 Nov 2023 09:08:09 +0100 Subject: [PATCH 3/3] Revert "apply suggestion from code review" This reverts commit 3f5436c633943ceb0f101022a6b3952e3fb3f3f6. --- base/reflection.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/reflection.jl b/base/reflection.jl index dc854ed1b8b5e..f22ba9fde838c 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -627,7 +627,7 @@ true !!! compat "Julia 1.5" This function requires at least Julia 1.5. """ -ismutable(@nospecialize(x)) = (@_total_meta; (inferencebarrier(typeof(x))::DataType).name.flags & 0x2 == 0x2) +ismutable(@nospecialize(x)) = (@_total_meta; (typeof(x).name::Core.TypeName).flags & 0x2 == 0x2) # The type assertion above is required to fix some invalidations. # See also https://github.com/JuliaLang/julia/issues/52134