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

Type-inference failure in matmul #1404

Closed
baggepinnen opened this issue Jan 16, 2025 · 1 comment
Closed

Type-inference failure in matmul #1404

baggepinnen opened this issue Jan 16, 2025 · 1 comment

Comments

@baggepinnen
Copy link
Collaborator

baggepinnen commented Jan 16, 2025

The eltype of the result infers to Any instead of Num

julia> @variables x
1-element Vector{Num}:
 x

julia> a = [x x]
1×2 Matrix{Num}:
 x  x

julia> a * a'
1×1 Matrix{Any}:
 2(x^2)

This is bad, since it leads to things like

ERROR: MethodError: no method matching zero(::Type{Any})

when trying to use the result

@baggepinnen
Copy link
Collaborator Author

fixed on master

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

No branches or pull requests

1 participant