@@ -1438,25 +1438,27 @@ function collectinvokes!(workqueue::CompilationQueue, ci::CodeInfo, sptypes::Vec
1438
1438
edge isa CodeInstance && isdefined (edge, :inferred ) && push! (workqueue, edge)
1439
1439
end
1440
1440
1441
+ invokelatest_queue === nothing && continue
1441
1442
if isexpr (stmt, :call )
1442
1443
farg = stmt. args[1 ]
1443
1444
! applicable (argextype, farg, ci, sptypes) && continue # TODO : Why is this failing during bootstrap
1444
1445
ftyp = widenconst (argextype (farg, ci, sptypes))
1445
- if ftyp <: Builtin
1446
- if Core. finalizer isa ftyp && length (stmt. args) == 3
1447
- finalizer = argextype (stmt. args[2 ], ci, sptypes)
1448
- obj = argextype (stmt. args[3 ], ci, sptypes)
1449
- atype = argtypes_to_type (Any[finalizer, obj])
1450
-
1451
- invokelatest_queue === nothing && continue
1452
- let workqueue = invokelatest_queue
1453
- # make a best-effort attempt to enqueue the relevant code for the finalizer
1454
- mi = compileable_specialization_for_call (workqueue. interp, atype)
1455
- mi === nothing && continue
1456
-
1457
- push! (workqueue, mi)
1458
- end
1459
- end
1446
+
1447
+ if ftyp === typeof (Core. finalizer) && length (stmt. args) == 3
1448
+ finalizer = argextype (stmt. args[2 ], ci, sptypes)
1449
+ obj = argextype (stmt. args[3 ], ci, sptypes)
1450
+ atype = argtypes_to_type (Any[finalizer, obj])
1451
+ else
1452
+ # No dynamic dispatch to resolve / enqueue
1453
+ continue
1454
+ end
1455
+
1456
+ let workqueue = invokelatest_queue
1457
+ # make a best-effort attempt to enqueue the relevant code for the finalizer
1458
+ mi = compileable_specialization_for_call (workqueue. interp, atype)
1459
+ mi === nothing && continue
1460
+
1461
+ push! (workqueue, mi)
1460
1462
end
1461
1463
end
1462
1464
# TODO : handle other StmtInfo like @cfunction and OpaqueClosure?
0 commit comments