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

The sum of two Array{T, 0}s should be an Array{T, 0} #32115

Closed
bzinberg opened this issue May 23, 2019 · 1 comment
Closed

The sum of two Array{T, 0}s should be an Array{T, 0} #32115

bzinberg opened this issue May 23, 2019 · 1 comment
Labels
domain:arrays [a, r, r, a, y, s]

Comments

@bzinberg
Copy link
Contributor

Minimal example:

julia> fill(1) + fill(2)
3

This causes pathologies such as

julia> fill(1) + fill(2) + fill(3)
6

julia> (fill(1) + fill(2)) + fill(3)
ERROR: MethodError: no method matching +(::Int64, ::Array{Int64,0})

(In my opinion it should be possible to add an Int64 to an Array{Int64, 0}, but that's a separate issue.)

bzinberg added a commit to probcomp/Gen.jl that referenced this issue May 23, 2019
@JeffBezanson JeffBezanson added domain:arrays [a, r, r, a, y, s] parser Language parsing and surface syntax and removed parser Language parsing and surface syntax labels May 23, 2019
@mbauman
Copy link
Sponsor Member

mbauman commented May 23, 2019

Thanks for the reminder. This is a dup of #28866, but this prompted me to propose a fix for it in #32122.

@mbauman mbauman closed this as completed May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:arrays [a, r, r, a, y, s]
Projects
None yet
Development

No branches or pull requests

3 participants