diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 17092ca4cf7519..82140f25253ff7 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -3910,7 +3910,10 @@ f(x) = yt(x) (val (if (equal? typ '(core Any)) val `(call (core typeassert) ,val - ,(cl-convert typ fname lam namemap defined toplevel interp opaq globals locals))))) + ,(let ((convt (cl-convert typ fname lam namemap defined toplevel interp opaq parsed-method-stack globals locals))) + (if (or (symbol-like? convt) (quoted? convt)) + convt + (renumber-assigned-ssavalues convt))))))) `(block ,@(if (eq? box access) '() `((= ,access ,box))) ,undefcheck diff --git a/test/syntax.jl b/test/syntax.jl index 1a2d61e821ef17..4bea07842e3f9a 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -3697,3 +3697,13 @@ module UndefGlobal54954 end using .UndefGlobal54954: theglobal54954 @test Core.get_binding_type(@__MODULE__, :theglobal54954) === Int + +# issue #45494 +begin + local b::Tuple{<:Any} = (0,) + function f45494() + b = b + b + end +end +@test f45494() === (0,)