I have a situation where I’m processing rowwise data from a JuliaDB table in a reducer. I’m having trouble with type stability, because my function looks like:

```
function (row, col)
value = row[col]
...do things with value...
end
```

This is not surprising because Julia doesn’t know at compile time which column y will be and, and therefore what type it is, and therefore it is unstable and causing allocations. But I know that `x[y]`

is an Int64, so I tried annotating the type:

```
function (row, col)
value::Int64 = row[col]::Int64
...do things with value...
end
```

but it is still unstable. How can I annotate `row[col]`

to avoid allocations?

Here’s a MWE (if you enclose the whole thing in a function, the allocations go away for both functions, but only because Julia can infer the value and type of t at compile time - which doesn’t solve my overall problem):

```
t = (abc=1, tba=2)
unstable(x, i) = x[i]
annotated(x, i) = x[i]::Int64
# run once to compile
unstable(t, :abc)
annotated(t, :abc)
println("no type annotation, allocation expected")
@time unstable(t, :abc) # -> 0.000018 seconds (1 allocation: 32 bytes)
println("type annotation, no allocation expected")
@time annotated(t, :abc) # -> 0.000004 seconds (1 allocation: 32 bytes)
```