Yes, do blocks can’t be documented, but perhaps a nicer error message would be more useful. Could you open an issue so this doesn’t get lost. Thanks.
— Mike On Friday, 13 May 2016 12:25:09 UTC+2, Eric Forgy wrote: > > Maybe a clue... > > Callback is a constructor, so I have many such docstrings before the > constructors, e.g. > > # """ > # Callback used to message a specified connected browser. > # """ > Callback("message") do args > message(args...) > end > > # """ > # Callback used to broadcast to all connected browsers. > # """ > Callback("broadcast") do args > broadcast(args...) > end > > # """ > # Callback used for blocking Julia control flow until notified by the > WebSocket. > # """ > Callback("notify") do name > if haskey(conditions,name) > notify(conditions[name]) > else > error("""Condition "$name" was not found.""") > end > end > > I guess I shouldn't use docstring in this case. My bad :) > > On Friday, May 13, 2016 at 6:16:25 PM UTC+8, Eric Forgy wrote: >> >> Hi, >> >> I am stumped on this one... >> >> I'm working on a package and, for the life of me, couldn't find my bug. >> So, on a hunch, I started commented out my docstrings one by one. I kept >> getting the error until I commented out the very last docstring and then >> the code worked as expected. So the source of my error is the docstring? >> >> Here's what it looks like: >> >> """ >> Callback used for blocking Julia control flow until notified by the >> WebSocket. >> """ >> Callback("notify") do name >> if haskey(conditions,name) >> notify(conditions[name]) >> else >> error("""Condition "$name" was not found.""") >> end >> end >> # This is line 50 in callbacks.jl >> >> This is the last code snippet in an included file. Running it, I get the >> following error: >> >> julia> using Pages >> ERROR: LoadError: LoadError: MethodError: `argtype` has no method >> matching argtype(::ASCIIString) >> in include at boot.jl:261 >> in include_from_node1 at loading.jl:320 >> in include at boot.jl:261 >> in include_from_node1 at loading.jl:320 >> in require at loading.jl:259 >> while loading C:\Users\Eric Forgy\.julia\v0.4\Pages\src\callbacks.jl, in >> expression starting on line 50 >> while loading C:\Users\Eric Forgy\.julia\v0.4\Pages\src\Pages.jl, in >> expression starting on line 56 >> >> If I comment out that last docstring, everything works as expected. >> >> julia> using Pages >> >> julia> Pages.start(); >> Listening on 0.0.0.0:8000... >> >> julia> include(Pkg.dir("Pages","examples","examples.jl")); >> >> Any ideas? >> >> julia> versioninfo() >> Julia Version 0.4.5 >> Commit 2ac304d (2016-03-18 00:58 UTC) >> Platform Info: >> System: Windows (x86_64-w64-mingw32) >> CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz >> WORD_SIZE: 64 >> BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell) >> LAPACK: libopenblas64_ >> LIBM: libopenlibm >> LLVM: libLLVM-3.3 >> >> Thanks! >> >