-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
compiler:loweringSyntax lowering (compiler front end, 2nd stage)Syntax lowering (compiler front end, 2nd stage)
Description
If I have a function with a nested type delegation (two wheres), I get the following incorrect warning
julia> foo(;a::T) where {T<:AbstractVector{N}} where {N} = zero(N)
WARNING: method definition for foo at REPL[5]:1 declares type variable N but does not use it.
WARNING: method definition for foo##kw at REPL[5]:1 declares type variable N but does not use it.
foo (generic function with 1 method)It is being used, as can be seen by these two executions of the function
julia> foo(a=[1.0])
0.0
julia> foo(a=[1])
0If I do something similar without nesting the type, it works fine with no warning
julia> bar(;a::N) where {N} = zero(N)
bar (generic function with 1 methods)Ran on 1.8.5 and latest 1.9 RC
julia> versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65ea (2023-01-08 06:45 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin21.5.0)
CPU: 8 × Apple M1
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, apple-m1)
Threads: 1 on 4 virtual coresjulia> versioninfo()
Julia Version 1.9.0-rc2
Commit 72aec423c2a (2023-04-01 10:41 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin21.3.0)
CPU: 8 × Apple M1
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
Threads: 1 on 4 virtual cores
Environment:
JULIA_IMAGE_THREADS = 1nrontsis and c42f
Metadata
Metadata
Assignees
Labels
compiler:loweringSyntax lowering (compiler front end, 2nd stage)Syntax lowering (compiler front end, 2nd stage)