Skip to content

Commit

Permalink
factor out rettype
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeInnes committed Mar 2, 2018
1 parent 55449ed commit 88f6bda
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/analysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,18 @@ function dispatch(warn, call)
end
end

# return type

function rettype(warn, call)
c, out = code(call)
isleaftype(out) || warn(call, "returns $out")
end

# overall analysis

function analyse(warn, call)
c, out = code(call)
globals(warn, call)
locals(warn, call)
dispatch(warn, call)
isleaftype(out) || warn(call, "returns $out")
rettype(warn, call)
end

0 comments on commit 88f6bda

Please sign in to comment.