diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index a1da941f34c31..8c0c1a319d0e5 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -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) @@ -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) diff --git a/test/core.jl b/test/core.jl index 774a81985af7b..69058b2bf42a2 100644 --- a/test/core.jl +++ b/test/core.jl @@ -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