Skip to content

Commit 30c7650

Browse files
authored
Fix some invalidations from using Images (#430)
There are some invalidations triggered by `ColorTypes` definition of a `length` method for `Colorant` types. The annotation in the comprehension is what fixes it. But there are a couple of other inference issues, and I may have been more specific in a previous annotation than merited by reality (not quite sure why it hasn't failed...)
1 parent 583de6c commit 30c7650

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/optimize.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ function build_compiled_call!(stmt::Expr, fcall, code, idx, nargs::Int, sparams:
273273
@assert arg isa SSAValue
274274
unsafe_convert_expr = code.code[arg.id]::Expr
275275
push!(delete_idx, arg.id) # delete the unsafe_convert
276-
cconvert_stmt = unsafe_convert_expr.args[3]
276+
cconvert_stmt = unsafe_convert_expr.args[3]::SSAValue
277277
push!(delete_idx, cconvert_stmt.id) # delete the cconvert
278278
cconvert_expr = code.code[cconvert_stmt.id]::Expr
279279
push!(args, cconvert_expr.args[3])
@@ -295,7 +295,7 @@ function build_compiled_call!(stmt::Expr, fcall, code, idx, nargs::Int, sparams:
295295
pc === nothing && error("this should never happen")
296296
end
297297
end
298-
cfunc, RetType, ArgType = @lookup(frame, stmt.args[2]), @lookup(frame, stmt.args[3]), @lookup(frame, stmt.args[4])::Type{<:Tuple}
298+
cfunc, RetType, ArgType = @lookup(frame, stmt.args[2]), @lookup(frame, stmt.args[3]), @lookup(frame, stmt.args[4])::DataType
299299
args = stmt.args[5:end]
300300
end
301301
dynamic_ccall = false
@@ -321,7 +321,7 @@ function build_compiled_call!(stmt::Expr, fcall, code, idx, nargs::Int, sparams:
321321
argnames = Any[Symbol(:arg, i) for i = 1:nargs]
322322
if f === nothing
323323
if fcall == :ccall
324-
ArgType = Expr(:tuple, Any[parametric_type_to_expr(t) for t in ArgType]...)
324+
ArgType = Expr(:tuple, Any[parametric_type_to_expr(t) for t in ArgType::SimpleVector]...)
325325
end
326326
RetType = parametric_type_to_expr(RetType)
327327
# #285: test whether we can evaluate an type constraints on parametric expressions

0 commit comments

Comments
 (0)