Skip to content

TypeError in methods(Core.Vararg) #34690

Closed
@yurivish

Description

@yurivish
Julia Version 1.3.1
Commit 2d5741174c (2019-12-30 21:36 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.6.0)
  CPU: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

julia> methods(Core.Symbol) # This works
# 6 methods for type constructor:
[1] Symbol(s::String) in Core at boot.jl:435
[2] Symbol(a::Array{UInt8,1}) in Core at boot.jl:440
[3] Symbol(s::Symbol) in Core at boot.jl:444
[4] Symbol(s::AbstractString) in Base at strings/basic.jl:205
[5] Symbol(x::Enum) in Base.Enums at Enums.jl:26
[6] Symbol(x...) in Base at strings/basic.jl:206

julia> methods(Core.Vararg) # This does not
ERROR: TypeError: in Type, in parameter, expected Type, got Vararg
Stacktrace:
 [1] signature_type(::Any, ::Any) at ./reflection.jl:767
 [2] _methods at ./reflection.jl:830 [inlined]
 [3] methods(::Any, ::Any) at ./reflection.jl:875
 [4] methods(::Any) at ./reflection.jl:890
 [5] top-level scope at REPL[24]:1

This came up in a code analyzer I'm writing which looks through symbols in lowered code (:Vararg), determines its defining module (Core), then checks whether it has any methods defined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions