Skip to content
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

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

Closed
nsajko opened this issue Feb 4, 2025 · 1 comment · Fixed by #57299
Closed

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

nsajko opened this issue Feb 4, 2025 · 1 comment · Fixed by #57299
Assignees
Labels
compiler:lowering Syntax lowering (compiler front end, 2nd stage) regression 1.12 Regression in the 1.12 release
Milestone

Comments

@nsajko
Copy link
Contributor

nsajko commented Feb 4, 2025

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

@nsajko nsajko added the regression 1.12 Regression in the 1.12 release label Feb 4, 2025
@Keno Keno added the compiler:lowering Syntax lowering (compiler front end, 2nd stage) label Feb 4, 2025
@Keno
Copy link
Member

Keno commented Feb 4, 2025

No, it's a lowering bug where it's not inserting the world age increment for the typealias, which is a bit of a syntax corner case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:lowering Syntax lowering (compiler front end, 2nd stage) regression 1.12 Regression in the 1.12 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants