Skip to content

Better line info for "missing comma or ) in argument list" error #16163

Closed
@KristofferC

Description

@KristofferC

Putting this in a file and include it:

function filler()
end

function g(a,b,c)
    f(a,b)
    f(a,b)
    f(a,(b,))
    f(a,(b,))
    f(a,(b,))
    f(a,(b,) # :(
    f(a,(b,))
    f(a,(b,))
    f(a,(b,))
end

gives the error message:

julia> include("test.jl")
ERROR: LoadError: syntax: missing comma or ) in argument list
 in include(::ASCIIString) at ./boot.jl:233
 in include_from_node1(::ASCIIString) at ./loading.jl:426
 in eval(::Module, ::Any) at ./boot.jl:236
while loading /home/kristoffer/Documents/test.jl, in expression starting on line 4

Is there anyway the line info could be a bit more specific than just the line of the start of the enclosing function?

Metadata

Metadata

Assignees

No one assigned

    Labels

    error handlingHandling of exceptions by Julia or the userparserLanguage parsing and surface syntax

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions