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

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

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

mcabbott
Copy link
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
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
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?

@mcabbott mcabbott merged commit 5732b97 into master Jan 4, 2025
9 of 11 checks passed
@mcabbott mcabbott deleted the mcabbott-patch-2 branch January 4, 2025 21:07
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