When I pass a composite type into a function, it doesn’t seem to know the element type even if it is explicitly defined. Should Julia be able to infer the type?
type TEST
Notes::AbstractArray{Float64}
Time::Float64
end
function foo(test::TEST)
tempvar1 = test.Notes[1]
tempvar2 = tempvar1*2. + test.Time
end
Variables:
#self#::#foo
test::TEST
tempvar1::Any
tempvar2::Any
Body:
begin
tempvar1::Any = (Main.getindex)((Core.getfield)(test::TEST, :Notes)::AbstractArray{Float64,N} where N, 1)::Any # line 3:
SSAValue(0) = ((tempvar1::Any * 2.0)::Any + (Core.getfield)(test::TEST, :Time)::Float64)::Any
return SSAValue(0)
end::Any