Skip to content

broadcast picking incorrect result type #4883

Closed

Description

The following code fails with an InexactError():

X = [1,2,3]
Y = [4 5]
broadcast(atan2, X, Y)

whereas

[atan2(x,y) for x in X, y in Y ]

(albeit producing an array of type Any), while

atan2([1,2,3],[4,5,6])

produces an array of Float64.

Can we improve the type inference so that all three cases can generate Float64 arrays? Note that this is needed for #4363 (for @vectorize_2arg to use broadcast).

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

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions