Skip to content

Commit 2616634

Browse files
authored
fix #45494, error in ssa conversion with complex type decl (#55744)
We were missing a call to `renumber-assigned-ssavalues` in the case where the declared type is used to assert the type of a value taken from a closure box.
1 parent 467ab85 commit 2616634

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/julia-syntax.scm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3977,7 +3977,10 @@ f(x) = yt(x)
39773977
(val (if (equal? typ '(core Any))
39783978
val
39793979
`(call (core typeassert) ,val
3980-
,(cl-convert typ fname lam namemap defined toplevel interp opaq parsed-method-stack globals locals)))))
3980+
,(let ((convt (cl-convert typ fname lam namemap defined toplevel interp opaq parsed-method-stack globals locals)))
3981+
(if (or (symbol-like? convt) (quoted? convt))
3982+
convt
3983+
(renumber-assigned-ssavalues convt)))))))
39813984
`(block
39823985
,@(if (eq? box access) '() `((= ,access ,box)))
39833986
,undefcheck

test/syntax.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3975,3 +3975,13 @@ module UsingFailedExplicit
39753975
using .A: x as x
39763976
@test x === 1
39773977
end
3978+
3979+
# issue #45494
3980+
begin
3981+
local b::Tuple{<:Any} = (0,)
3982+
function f45494()
3983+
b = b
3984+
b
3985+
end
3986+
end
3987+
@test f45494() === (0,)

0 commit comments

Comments
 (0)