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

promote_typeof is a Julia implementation detail #17

Open
nsajko opened this issue Apr 18, 2024 · 1 comment
Open

promote_typeof is a Julia implementation detail #17

nsajko opened this issue Apr 18, 2024 · 1 comment

Comments

@nsajko
Copy link

nsajko commented Apr 18, 2024

# Promotion
# We need to override promote and promote_typeof because they don't even call
# promote_rule for all-same types.
Base.promote(::ST, ys::ST...) where {ST <: Static{X}} where {X} = ntuple(i->X, static(1+length(ys)))
Base.promote_type(::Type{ST}, ::Type{ST}) where {ST <: Static{X}} where {X} = typeof(X)
Base.promote_typeof(::ST, ::ST...) where {ST <: Static{X}} where {X} = typeof(X)

I know this package is somewhat special, but, ideally, you'd try to make issues and/or PRs to upstream (Julia) instead of just silently using internal implementation details. Especially with the new changes coming in the upcoming release (Julia v1.11).

@nsajko
Copy link
Author

nsajko commented Apr 18, 2024

Related: promote_type is not supposed to be overloaded, xref JuliaLang/julia#54138

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