You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I thought it was guaranteed that staged functions would be called with concrete types, but the following code seems to trick Julia into calling a stagedfunction with Any:
stagedfunction foo(t)
@show t
return
end
x = Array(Float64, 5)
let
x = Array(Int,3)
for i in 1:3
x[i] = i
end
foo(x[1])
end
prints
t = Any
t = Any
This behavior is highly sensitive to the structure, if you remove let or the assignment to x[i], then the function is called correctly with Int.
I thought it was guaranteed that staged functions would be called with concrete types, but the following code seems to trick Julia into calling a stagedfunction with
Any
:prints
This behavior is highly sensitive to the structure, if you remove
let
or the assignment tox[i]
, then the function is called correctly withInt
.CC @Keno @timholy
The text was updated successfully, but these errors were encountered: