Skip to content

Printing of function names that are invalid identifiers (var"...") in stacktraces doesn't always work right #58790

Open
@CameronBieganek

Description

@CameronBieganek

This works as expected:

julia> var"#foo#bar"() = throw(ArgumentError("oops"));

julia> qwer() = var"#foo#bar"();

julia> qwer()
ERROR: ArgumentError: oops
Stacktrace:
 [1] var"#foo#bar"()
   @ Main ./REPL[4]:1
 [2] qwer()
   @ Main ./REPL[5]:1
 [3] top-level scope
   @ REPL[6]:1

But this does not:

julia> var"foo#bar"() = throw(ArgumentError("oops"));

julia> asdf() = var"foo#bar"();

julia> asdf()
ERROR: ArgumentError: oops
Stacktrace:
 [1] foo()
   @ Main ./REPL[1]:1
 [2] asdf()
   @ Main ./REPL[2]:1
 [3] top-level scope
   @ REPL[3]:1

Note that in the second example, the function name does not start with #, and the stacktrace prints foo() instead of var"foo#bar"().

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