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

Broadcasting picks wrong method in 1.8.1 #46722

Closed
sostock opened this issue Sep 12, 2022 · 0 comments · Fixed by #46799
Closed

Broadcasting picks wrong method in 1.8.1 #46722

sostock opened this issue Sep 12, 2022 · 0 comments · Fixed by #46799
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior priority This should be addressed urgently regression Regression in behavior compared to a previous version

Comments

@sostock
Copy link
Contributor

sostock commented Sep 12, 2022

See PainterQubits/Unitful.jl#557:

julia> using Unitful;

julia> [1.0u"m", 2.0u"m"] .+ 3.0u"m"
2-element Vector{Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}:
 4.0 m
 5.0 m

julia> Any[1.0u"m", 2.0u"m"] .+ 3.0u"m"
ERROR: + not defined for Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}
[...]
  • [1.0u"m", 2.0u"m"] .+ 3.0u"m" uses
    +(x::AbstractQuantity{S,D,U}, y::AbstractQuantity{T,D,U}) where {S,T,D,U} in Unitful at src/quantities.jl:125
  • Any[1.0u"m", 2.0u"m"] .+ 3.0u"m" uses
    +(x::T, y::T) where T<:Number in Base at promotion.jl:463` and therefore errors.

It worked on 1.8.0 and is broken on 1.8.1 and master. For the regression from 1.8.0 to 1.8.1, bisect blames 5d03fcd, which is the backport of #46535.

@sostock sostock added regression Regression in behavior compared to a previous version bug Indicates an unexpected problem or unintended behavior labels Sep 12, 2022
@KristofferC KristofferC added the priority This should be addressed urgently label Sep 13, 2022
@aviatesk aviatesk self-assigned this Sep 13, 2022
aviatesk added a commit that referenced this issue Sep 16, 2022
Sometimes `Core.Compiler.findall(::Type, ::CachedMethodTable; limit::Int)`
is called with different `limit` setting (particularly `return_type_tfunc`
will call it with `limit=-1`), and it should return different results
given different `limit` settings.

fix #46722
aviatesk added a commit that referenced this issue Sep 16, 2022
Sometimes `Core.Compiler.findall(::Type, ::CachedMethodTable; limit::Int)`
is called with different `limit` setting (in particularity
`return_type_tfunc` calls it with `limit=-1`). The query should return
different results given different `limit` settings, so its cache should
also have different keys per different `limit` settings.

fix #46722
aviatesk added a commit that referenced this issue Sep 17, 2022
…46799)

Sometimes `Core.Compiler.findall(::Type, ::CachedMethodTable; limit::Int)`
is called with different `limit` setting (in particularity
`return_type_tfunc` calls it with `limit=-1`). The query should return
different results given different `limit` settings, so its cache should
also have different keys per different `limit` settings.

fix #46722
aviatesk added a commit that referenced this issue Sep 17, 2022
…46799)

Sometimes `Core.Compiler.findall(::Type, ::CachedMethodTable; limit::Int)`
is called with different `limit` setting (in particularity
`return_type_tfunc` calls it with `limit=-1`). The query should return
different results given different `limit` settings, so its cache should
also have different keys per different `limit` settings.

fix #46722
KristofferC pushed a commit that referenced this issue Sep 19, 2022
…46799)

Sometimes `Core.Compiler.findall(::Type, ::CachedMethodTable; limit::Int)`
is called with different `limit` setting (in particularity
`return_type_tfunc` calls it with `limit=-1`). The query should return
different results given different `limit` settings, so its cache should
also have different keys per different `limit` settings.

fix #46722
KristofferC pushed a commit that referenced this issue Sep 19, 2022
…46799)

Sometimes `Core.Compiler.findall(::Type, ::CachedMethodTable; limit::Int)`
is called with different `limit` setting (in particularity
`return_type_tfunc` calls it with `limit=-1`). The query should return
different results given different `limit` settings, so its cache should
also have different keys per different `limit` settings.

fix #46722
aviatesk added a commit that referenced this issue Dec 9, 2022
…46799)

Sometimes `Core.Compiler.findall(::Type, ::CachedMethodTable; limit::Int)`
is called with different `limit` setting (in particularity
`return_type_tfunc` calls it with `limit=-1`). The query should return
different results given different `limit` settings, so its cache should
also have different keys per different `limit` settings.

fix #46722
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior priority This should be addressed urgently regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants