File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -1051,10 +1051,13 @@ function check_world_bounded(tn::Core.TypeName)
1051
1051
isdefined (bnd, :partitions ) || return nothing
1052
1052
partition = @atomic bnd. partitions
1053
1053
while true
1054
- if is_defined_const_binding (binding_kind (partition)) && partition_restriction (partition) <: tn.wrapper
1055
- max_world = @atomic partition. max_world
1056
- max_world == typemax (UInt) && return nothing
1057
- return Int (partition. min_world): Int (max_world)
1054
+ if is_defined_const_binding (binding_kind (partition))
1055
+ cval = partition_restriction (partition)
1056
+ if isa (cval, Type) && cval <: tn.wrapper
1057
+ max_world = @atomic partition. max_world
1058
+ max_world == typemax (UInt) && return nothing
1059
+ return Int (partition. min_world): Int (max_world)
1060
+ end
1058
1061
end
1059
1062
isdefined (partition, :next ) || return nothing
1060
1063
partition = @atomic partition. next
Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ module Rebinding
18
18
@test Base. binding_kind (@__MODULE__ , :Foo ) == Base. BINDING_KIND_GUARD
19
19
@test contains (repr (x), " @world" )
20
20
21
+ # Test that it still works if Foo is redefined to a non-type
22
+ const Foo = 1
23
+
24
+ @test Base. binding_kind (@__MODULE__ , :Foo ) == Base. BINDING_KIND_CONST
25
+ @test contains (repr (x), " @world" )
26
+ Base. delete_binding (@__MODULE__ , :Foo )
27
+
21
28
struct Foo
22
29
x:: Int
23
30
end
You can’t perform that action at this time.
0 commit comments