Skip to content

Commit

Permalink
Merge pull request #15812 from JuliaLang/jb/fix15809
Browse files Browse the repository at this point in the history
fix #15809, lowering bug in out-of-scope method adds with static params
  • Loading branch information
JeffBezanson committed Apr 10, 2016
2 parents 59cf4cd + e8b0906 commit 4eced1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2717,7 +2717,7 @@ f(x) = yt(x)
(if (not local?) ;; not a local function; will not be closure converted to a new type
(cond (short e)
((null? cvs)
`(toplevel-butlast
`(block
,@sp-inits
(method ,name ,(cl-convert sig fname lam namemap toplevel interp)
(lambda ,(cadr lam2)
Expand All @@ -2739,7 +2739,7 @@ f(x) = yt(x)
(car vi)))
(list ,@(cadr vi)) ,(caddr vi) (list ,@(cadddr vi)))
,@(cdddr newlam))))
`(toplevel-butlast
`(block
,@top-stmts
,@sp-inits
(method ,name ,(cl-convert sig fname lam namemap toplevel interp)
Expand Down
8 changes: 8 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3749,3 +3749,11 @@ end
@noinline function f15425(x)
end
@test f15425(1) === nothing

# issue #15809 --- TODO: this code should be disallowed
function f15809()
global g15809
g15809{T}(x::T) = T
end
f15809()
@test g15809(2) === Int

0 comments on commit 4eced1a

Please sign in to comment.