diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index ce962b33dc16d..7bf873c586c84 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -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 diff --git a/test/core.jl b/test/core.jl index 81d8b36db7706..1f63975630aa5 100644 --- a/test/core.jl +++ b/test/core.jl @@ -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)