Skip to content

Internal errors caused by broken Varargs #51228

@maleadt

Description

@maleadt

I'm not sure we care, given that this Vararg is very wrong, but I guess it maybe shouldn't throw an internal error:

f(x=whatever) = 1
f(::Vararg{1}) = 2
f()
julia> f()
Internal error: encountered unexpected error in runtime:
MethodError(f=Core.Compiler.widenconst, args=(1,), world=0x00000000000015a5)
jl_method_error_bare at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-R17H3W25T9.0/build/default-honeycrisp-R17H3W25T9-0/julialang/julia-release-1-dot-10/src/gf.c:2203
jl_method_error at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-R17H3W25T9.0/build/default-honeycrisp-R17H3W25T9-0/julialang/julia-release-1-dot-10/src/gf.c:2221
jl_lookup_generic_ at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-R17H3W25T9.0/build/default-honeycrisp-R17H3W25T9-0/julialang/julia-release-1-dot-10/src/gf.c:3052 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-R17H3W25T9.0/build/default-honeycrisp-R17H3W25T9-0/julialang/julia-release-1-dot-10/src/gf.c:3067
tuple_tfunc at ./compiler/tfuncs.jl:1927
most_general_argtypes at ./compiler/inferenceresult.jl:151
most_general_argtypes at ./compiler/inferenceresult.jl:109 [inlined]
matching_cache_argtypes at ./compiler/inferenceresult.jl:27 [inlined]
InferenceResult at ./compiler/types.jl:88 [inlined]
typeinf_edge at ./compiler/typeinfer.jl:919
...
ERROR: UndefVarError: `whatever` not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions