Using Ref{T}
to get a mutable field in an otherwise immutable struct is causing inference problems (Julia v1.03/v1.1.0), MWE:
using Test
struct A
i::Ref{Int}
end
get_i(x) = x.i[]
@inferred get_i(A(2)) # ERROR: return type Int64 does not match inferred return type Any
Should I file an issue or is there more idiomatic way to do this?