Skip to content

Use return_type not _return_type to fix an error on nightly#618

Merged
mcabbott merged 1 commit intomasterfrom
mcabbott-patch-2
Jan 4, 2025
Merged

Use return_type not _return_type to fix an error on nightly#618
mcabbott merged 1 commit intomasterfrom
mcabbott-patch-2

Conversation

@mcabbott
Copy link
Copy Markdown
Member

@mcabbott mcabbott commented Jan 4, 2025

This change should be harmless on Julia 1.10 and 1.11, but fix an error on 1.12. It's an internal function so we did sign up to fix things as needed.

julia> VERSION
v"1.10.7"

julia> Core.Compiler.return_type(sin, Tuple{Int})
Float64

julia> Core.Compiler._return_type(sin, Tuple{Int})
Float64
julia> VERSION
v"1.11.2"

julia> Core.Compiler.return_type(sin, Tuple{Int})
Float64

julia> Core.Compiler._return_type(sin, Tuple{Int})
Float64

Master:

julia> VERSION
v"1.12.0-DEV.1731"

julia> Core.Compiler.return_type(sin, Tuple{Int})
Float64

julia> Core.Compiler._return_type(sin, Tuple{Int})
ERROR: MethodError: no method matching _return_type(::typeof(sin), ::Type{Tuple{Int64}})
You may have intended to import Base._return_type
The function `_return_type` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  _return_type(::Compiler.AbstractInterpreter, ::DataType)
   @ Base ../usr/share/julia/Compiler/src/typeinfer.jl:1244

@mcabbott
Copy link
Copy Markdown
Member Author

mcabbott commented Jan 4, 2025

Note aside that this package tests Zygote but does not constrain the version, hence CI is testing Zygote v0.7.0 here, with thunks from FluxML/Zygote.jl#966

Copy link
Copy Markdown
Member

@ToucheSir ToucheSir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall why we opted to not constrain test dependencies in test/Project.toml, does anyone remember?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants