Skip to content

Misleading error when parsing doc expression with missing macro #13905

@andrewcooke

Description

@andrewcooke

Parsing a documented function with a missing (undefined) macro gives an error related to the doc expression (which is valid):

andrew@laptop:/tmp> cat nasty.jl

"""this is a doc string"""
function myfunc()
    @doesnotexist begin
    end
end

andrew@laptop:/tmp> julia-0.4 nasty.jl
ERROR: LoadError: invalid doc expression:

function myfunc()
    $(Expr(:line, 4, symbol("/tmp/nasty.jl")))
    @doesnotexist begin
        end
end
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:308
 in _start at ./client.jl:411
while loading /tmp/nasty.jl, in expression starting on line 7

Using

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.1-pre+22 (2015-11-01 00:06 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 669222e (5 days old release-0.4)
|__/                   |  x86_64-suse-linux

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