Skip to content

Commit

Permalink
fix #19106, ret type decl on function with empty body
Browse files Browse the repository at this point in the history
(cherry picked from commit 4ba66e3)
ref #19114
  • Loading branch information
JeffBezanson authored and tkelman committed Feb 22, 2017
1 parent 3053b58 commit 399a1b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3370,7 +3370,7 @@ f(x) = yt(x)
;; strip filenames out of non-initial line nodes
(emit `(line ,(cadr e)))))
((and (eq? (car e) 'meta) (length> e 2) (eq? (cadr e) 'ret-type))
(assert (not value))
(assert (or (not value) tail))
(assert (not rett))
(set! rett (caddr e)))
(else
Expand Down
4 changes: 4 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4402,6 +4402,10 @@ Base.convert(::Type{Int}, ::A1090) = "hey"
f1090()::Int = A1090()
@test_throws TypeError f1090()

# issue #19106
function f19106()::Void end
@test f19106() === nothing

# issue #16783
function f16783()
T = UInt32
Expand Down

0 comments on commit 399a1b7

Please sign in to comment.