Skip to content

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

Open
@nsajko

Description

@nsajko
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviortypes and dispatchTypes, subtyping and method dispatch

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions