Skip to content

strict world age semantics for global bindings warnings, not sure if warranted #57267

@nsajko

Description

@nsajko

On master this simple type alias definition produces a warning:

julia> abstract type A{S, T} end

julia> @eval begin
           A1{S} = A{S, 1}
           const A2 = A1
       end
WARNING: Detected access to binding `Main.A1` in a world prior to its definition world.
  Julia 1.12 has introduced more strict world age semantics for global bindings.
  !!! This code may malfunction under Revise.
  !!! This code will error in future versions of Julia.
Hint: Add an appropriate `invokelatest` around the access to this binding.
A{S, 1} where S

However, using a different syntax for the type alias doesn't result in a warning:

julia> abstract type A{S, T} end

julia> @eval begin
           const A1 = A{S, 1} where {S}
           const A2 = A1
       end
A{S, 1} where S

Affects FillArrays.jl: JuliaArrays/FillArrays.jl#402

@Keno

Metadata

Metadata

Assignees

Labels

compiler:loweringSyntax lowering (compiler front end, 2nd stage)regression 1.12Regression in the 1.12 release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions