-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Second of two consecutive strings is ignored #12737
Comments
Possibly related:
The doc string seems to be printed. |
Hah, you just documented |
I'm not sure we need to allow documenting strings. It seems like in every case you'd want to document a string-valued variable instead of the string itself. |
It seems that one can document functions, variable definitions, and simple values (e.g. strings, integers). Expressions and function calls cannot be documented; this leads to a method error. |
I've traced the problem down to operators.jl, which is compiled after about a dozen other .jl files by sysimg.jl. Docstrings in files earlier than that (e.g. range.jl) can get the error. Also docstrings in operators.jl up to line 11: |
This isn't addressed by #13602. The reference in #13534 (comment) to this issue was regarding duplicating the docstring appearing to fix the issue, not the |
Doesn't #13602 now allow early docstrings? My interpretation is that if you had a docstring earlier than that line 11, the original code was using == before it was defined as such, and caused errors, as was the case in #13534. Not by fixing that line 11, but allowing docstrings to be defined without relying on it. I hope I'm not misunderstanding. In any case, #13602 was a nice fix and certainly cleared up the problem I was seeing. |
This fixes JuliaLang#12737 by throwing an error when trying to document unbound string literals. String-valued variables can still be documented though. Also improves error reporting for invalid doc expressions and adds tests.
With Julia 0.4.0-dev, the input
"a" "b"
in the REPL leads to the output"a"
instead of a string concatenation or an error. The second string"b"
is silently discarded.The text was updated successfully, but these errors were encountered: