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

error when eval'ing definitions with interpolated variables if module has a docstring during bootstrap #22288

Open
rfourquet opened this issue Jun 8, 2017 · 5 comments
Labels
docsystem The documentation building system

Comments

@rfourquet
Copy link
Member

To reproduce, add this in a file from Base (listed in "sysimg.jl").

"""
A
"""
module A

let T = Int
   @eval a(::$T) = 0
end

end

It's enough to attach the docstring to :A before the module declaration (or to A after) to solve the problem.

@rfourquet rfourquet added docsystem The documentation building system bug Indicates an unexpected problem or unintended behavior labels Jun 8, 2017
@yuyichao yuyichao changed the title error when eval'ing definitions with interpolated variables if module has a docstring error when eval'ing definitions with interpolated variables if module has a docstring during bootstrap Jun 8, 2017
@yuyichao
Copy link
Contributor

yuyichao commented Jun 8, 2017

If you are reporting an error you should actually give the error message....

In this case it's

LoadError("sysimg.jl", 428, UndefVarError(:T))

And it only happens if you put it before the doc system is ready (i.e. add this in a file from Base is not enough to reproduce). It is expected (so not a critical bug, but can possibly be improved) that the doc system accept only limited syntax before it is defined.

@yuyichao yuyichao removed the bug Indicates an unexpected problem or unintended behavior label Jun 8, 2017
@rfourquet
Copy link
Member Author

Sorry for not mentioning the error message. I don't know when the doc system is ready, but I could reproduce this bug by putting the code in files close to either the beginning or the end of "sysimg.jl". It didn't appear to me that the doc system accepts a limitied syntax, as e.g. in test.jl the normal syntax for documenting the module is accepted: the problem comes then if I try to use @eval with an interpolated variable.

@yuyichao
Copy link
Contributor

yuyichao commented Jun 8, 2017

It'll not error if you put it after include("docs/Docs.jl")

if I try to use @eval with an interpolated variable.

And that's the limitted syntax I'm talking about.

@rfourquet
Copy link
Member Author

the doc system accept only limited syntax before it is defined.

Ok, I didn't see @eval as part of the doc system.

@yuyichao
Copy link
Contributor

yuyichao commented Jun 8, 2017

I didn't see @eval as part of the doc system.

It's not. The evaluation rule is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docsystem The documentation building system
Projects
None yet
Development

No branches or pull requests

2 participants