Consider

  immutable A
      a::Int
      b::Float64
  end
  aa = A(4,5)

  f{ab}(aa, ::Val{ab}) = getfield(aa, ab)
  @code_warntype f(aa, Val{:b}())

In Julia 0.5 the inferred return type is Float64, however, in 0.4 it's
Union{Int,Float64}.  Is there a way to make this type stable in 0.4?

(Needed in Parameters.jl, see
https://github.com/mauro3/Parameters.jl/pull/13#issuecomment-247687338 )

Reply via email to