We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Reported by @ccoffrin in jump-dev/JuMP.jl#2120 (comment)
julia> using MutableArithmetics julia> @rewrite(sum(1 for i in 1:0) * sum(1 for i in 1:0)) ERROR: MethodError: no method matching *(::MutableArithmetics.Zero, ::MutableArithmetics.Zero) Closest candidates are: *(::Any, ::Any, ::Any, ::Any...) at operators.jl:529 Stacktrace: [1] operate(::typeof(*), ::MutableArithmetics.Zero, ::MutableArithmetics.Zero) at /home/blegat/.julia/dev/MutableArithmetics/src/interface.jl:88 [2] operate(::typeof(MutableArithmetics.add_mul), ::MutableArithmetics.Zero, ::MutableArithmetics.Zero, ::MutableArithmetics.Zero) at /home/blegat/.julia/dev/MutableArithmetics/src/rewrite.jl:35 [3] operate_fallback!(::MutableArithmetics.NotMutable, ::Function, ::MutableArithmetics.Zero, ::MutableArithmetics.Zero, ::MutableArithmetics.Zero) at /home/blegat/.julia/dev/MutableArithmetics/src/interface.jl:275 [4] operate!(::Function, ::MutableArithmetics.Zero, ::MutableArithmetics.Zero, ::MutableArithmetics.Zero) at /home/blegat/.julia/dev/MutableArithmetics/src/interface.jl:271 [5] top-level scope at /home/blegat/.julia/dev/MutableArithmetics/src/rewrite.jl:195 julia> @rewrite(sum(1 for i in 1:0) * 1^2) ERROR: MethodError: no method matching *(::MutableArithmetics.Zero, ::Int64) Closest candidates are: *(::Any, ::Any, ::Any, ::Any...) at operators.jl:529 *(::Complex{Bool}, ::Real) at complex.jl:305 *(::Missing, ::Number) at missing.jl:115 ... Stacktrace: [1] operate(::typeof(*), ::MutableArithmetics.Zero, ::Int64) at /home/blegat/.julia/dev/MutableArithmetics/src/interface.jl:88 [2] operate(::typeof(MutableArithmetics.add_mul), ::MutableArithmetics.Zero, ::MutableArithmetics.Zero, ::Int64) at /home/blegat/.julia/dev/MutableArithmetics/src/rewrite.jl:35 [3] operate_fallback!(::MutableArithmetics.NotMutable, ::Function, ::MutableArithmetics.Zero, ::MutableArithmetics.Zero, ::Int64) at /home/blegat/.julia/dev/MutableArithmetics/src/interface.jl:275 [4] operate!(::Function, ::MutableArithmetics.Zero, ::MutableArithmetics.Zero, ::Int64) at /home/blegat/.julia/dev/MutableArithmetics/src/interface.jl:271 [5] top-level scope at /home/blegat/.julia/dev/MutableArithmetics/src/rewrite.jl:195 julia> @rewrite(BigInt(1) + sum(1 for i in 1:0) * 1^2) ERROR: MethodError: no method matching zero(::Type{MutableArithmetics.Zero}) Closest candidates are: zero(::Type{Missing}) at missing.jl:103 zero(::Type{LibGit2.GitHash}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/LibGit2/src/oid.jl:220 zero(::Type{Pkg.Resolve.VersionWeights.VersionWeight}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/resolve/VersionWeights.jl:19 ... Stacktrace: [1] promote_operation(::typeof(*), ::Type, ::Type) at /home/blegat/.julia/dev/MutableArithmetics/src/interface.jl:21 [2] promote_operation(::typeof(MutableArithmetics.add_mul), ::Type, ::Type, ::Type) at /home/blegat/.julia/dev/MutableArithmetics/src/shortcuts.jl:53 [3] mutability(::Type, ::Function, ::Type, ::Type, ::Type) at /home/blegat/.julia/dev/MutableArithmetics/src/interface.jl:132 [4] mutability(::BigInt, ::Function, ::BigInt, ::MutableArithmetics.Zero, ::Int64) at /home/blegat/.julia/dev/MutableArithmetics/src/interface.jl:138 [5] operate!(::Function, ::BigInt, ::MutableArithmetics.Zero, ::Int64) at /home/blegat/.julia/dev/MutableArithmetics/src/interface.jl:271 [6] top-level scope at /home/blegat/.julia/dev/MutableArithmetics/src/rewrite.jl:195
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Reported by @ccoffrin in jump-dev/JuMP.jl#2120 (comment)
The text was updated successfully, but these errors were encountered: