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)
10511051 isdefined (bnd, :partitions ) || return nothing
10521052 partition = @atomic bnd. partitions
10531053 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
10581061 end
10591062 isdefined (partition, :next ) || return nothing
10601063 partition = @atomic partition. next
Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ module Rebinding
1818 @test Base. binding_kind (@__MODULE__ , :Foo ) == Base. BINDING_KIND_GUARD
1919 @test contains (repr (x), " @world" )
2020
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+
2128 struct Foo
2229 x:: Int
2330 end
You can’t perform that action at this time.
0 commit comments