File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,7 @@ function is_doc_expr(@nospecialize(ex))
226226 docsym = Symbol (" @doc" )
227227 if isexpr (ex, :macrocall )
228228 ex:: Expr
229+ length (ex. args) == 4 || return false
229230 a = ex. args[1 ]
230231 is_global_ref (a, Core, docsym) && return true
231232 isa (a, Symbol) && a == docsym && return true
Original file line number Diff line number Diff line change 3636 io = IOBuffer ()
3737 show (io, @doc (Main. DocStringTest))
3838 @test occursin (" Special" , String (take! (io)))
39+ # issue #538
40+ @test ! JuliaInterpreter. is_doc_expr (:(Core. @doc " string" ))
41+ ex = quote
42+ @doc (" no docstring" )
43+
44+ sum
45+ end
46+ modexs = collect (ExprSplitter (Main, ex))
47+ m, ex = first (modexs)
48+ @test ! JuliaInterpreter. is_doc_expr (ex. args[2 ])
3949
4050 @test ! isdefined (Main, :JIInvisible )
4151 collect (ExprSplitter (JIVisible, :(module JIInvisible f () = 1 end )))
561571 @test JuliaInterpreter. finish! (Frame (mod, ex), true ) === nothing
562572 end
563573 @test length (modexs) == 2
564- end
574+ end
You can’t perform that action at this time.
0 commit comments