Skip to content

Commit

Permalink
fix lowering bug in closure sparams ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Jul 17, 2016
1 parent a943c92 commit 547375b
Show file tree
Hide file tree
Showing 2 changed files with 9 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 @@ -2835,7 +2835,7 @@ f(x) = yt(x)
(if lam2 (lam:sp lam2) '())
(map (lambda (methdef) (lam:sp (cadddr methdef)))
alldefs))))
(capt-sp (intersect cvs sps))
(capt-sp (simple-sort (intersect cvs sps)))
(capt-vars (diff cvs capt-sp))
(method-sp (map (lambda (s) (make-ssavalue)) capt-sp))
(typedef ;; expression to define the type
Expand Down
8 changes: 8 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4463,3 +4463,11 @@ end
f17147(::Tuple) = 1
f17147{N}(::Vararg{Tuple,N}) = 2
@test f17147((), ()) == 2

# make sure lowering agrees on sp order
function captsp{T, S}(x::T, y::S)
subf(x2::Int) = T
subf(x2::UInt) = S
return subf(Int(1)), subf(UInt(1))
end
@test captsp(1, 2.0) == (Int, Float64)

0 comments on commit 547375b

Please sign in to comment.