@@ -1324,21 +1324,32 @@ function collectinvokes!(workqueue::CompilationQueue, ci::CodeInfo, sptypes::Vec
13241324        invokelatest_queue ===  nothing  &&  continue 
13251325        if  isexpr (stmt, :call )
13261326            farg =  stmt. args[1 ]
1327+ 
1328+             invokelatest_queue ===  nothing  &&  continue 
13271329            ! applicable (argextype, farg, ci, sptypes) &&  continue  #  TODO : Why is this failing during bootstrap
1330+ 
13281331            ftyp =  widenconst (argextype (farg, ci, sptypes))
13291332
13301333            if  ftyp ===  typeof (Core. finalizer) &&  length (stmt. args) ==  3 
1331-                 finalizer =  argextype (stmt. args[2 ], ci, sptypes)
1332-                 obj =  argextype (stmt. args[3 ], ci, sptypes)
1333-                 atype =  argtypes_to_type (Any[finalizer, obj])
1334+                 finalizer_fn =  argextype (stmt. args[2 ], ci, sptypes)
1335+                 object =  argextype (stmt. args[3 ], ci, sptypes)
1336+                 atype =  argtypes_to_type (Any[finalizer_fn, object])
1337+             elseif  ftyp ===  typeof (Core. _predeclare_call) &&  length (stmt. args) >  1 
1338+                 atype =  argtypes_to_type (Any[
1339+                     argextype (stmt. args[i], ci, sptypes)
1340+                     for  i in  2 : length (stmt. args)
1341+                 ])
1342+             else 
1343+                 #  No dynamic dispatch to resolve / enqueue
1344+                 continue 
1345+             end 
13341346
1335-                  let  workqueue =  invokelatest_queue
1336-                      #  make a best-effort attempt to enqueue the relevant code for the finalizer
1337-                      mi =  compileable_specialization_for_call (workqueue. interp, atype)
1338-                      mi ===  nothing  &&  continue 
1347+             let  workqueue =  invokelatest_queue
1348+                 #  make a best-effort attempt to enqueue the relevant code for the finalizer
1349+                 mi =  compileable_specialization_for_call (workqueue. interp, atype)
1350+                 mi ===  nothing  &&  continue 
13391351
1340-                     push! (workqueue, mi)
1341-                 end 
1352+                 push! (workqueue, mi)
13421353            end 
13431354        end 
13441355        #  TODO : handle other StmtInfo like @cfunction and OpaqueClosure?
0 commit comments