Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading error when parsing doc expression with missing macro #13905

Closed
andrewcooke opened this issue Nov 7, 2015 · 0 comments
Closed

Misleading error when parsing doc expression with missing macro #13905

andrewcooke opened this issue Nov 7, 2015 · 0 comments

Comments

@andrewcooke
Copy link
Contributor

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
MichaelHatherly added a commit to MichaelHatherly/julia that referenced this issue Nov 7, 2015
When `macroexpand` fails due to an undefined macro in the expression
return the resulting error rather than the more generic and misleading
"invalid doc expression..." error message.

Fixes JuliaLang#13905.
tkelman pushed a commit that referenced this issue Nov 7, 2015
When `macroexpand` fails due to an undefined macro in the expression
return the resulting error rather than the more generic and misleading
"invalid doc expression..." error message.

Fixes #13905.

(cherry picked from commit c4c38d1)
ref #13908
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant