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

method static parameter matching bug involving a lower bound on a type parameter: parameter should be defined but is not #57427

Open
nsajko opened this issue Feb 16, 2025 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch

Comments

@nsajko
Copy link
Contributor

nsajko commented Feb 16, 2025

julia> struct S{N, Tup}
           function S{N, Tup}() where {N, Tuple{Vararg{Nothing, N}} <: Tup <: Tuple{Vararg{Nothing, N}}}
               new{N, Tup}()
           end
       end

julia> S{0, Tuple{}}()
ERROR: UndefVarError: `Tup` not defined in static parameter matching
Suggestion: run Test.detect_unbound_args to detect method arguments that do not fully constrain a type parameter.
Stacktrace:
 [1] S{0, Tuple{}}()
   @ Main ./REPL[1]:3
 [2] top-level scope
   @ REPL[2]:1

Removing the lower bound is a workaround.

@nsajko nsajko added bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch labels Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

1 participant