@@ -512,6 +512,28 @@ def process_advance_block_retry( # noqa: C901
512512 result , background , new_scope , trace = process_block_body (
513513 state , scope , block , loc
514514 )
515+
516+ result = lazy_apply (id_with_set_first_use_nanos (block .pdl__timing ), result )
517+ add_done_callback (
518+ id_with_set_first_use_nanos (block .pdl__timing ), background
519+ )
520+ trace = trace .model_copy (update = {"pdl__result" : result })
521+ if block .parser is not None :
522+ parser_func = partial (parse_result , block .parser )
523+ result = lazy_apply (parser_func , result )
524+ if init_state .yield_result :
525+ yield_result (result , block .kind )
526+ if block .spec is not None and not isinstance (block , FunctionBlock ):
527+ checker = partial (
528+ result_with_type_checking ,
529+ spec = block .spec ,
530+ msg = "Type errors during spec checking:" ,
531+ loc = append (loc , "spec" ),
532+ trace = trace ,
533+ )
534+ result = lazy_apply (checker , result )
535+ if block .fallback is not None :
536+ result .result ()
515537 if block .requirements != []:
516538 requirements_satisfied = True
517539 for req in block .requirements :
@@ -541,28 +563,6 @@ def process_advance_block_retry( # noqa: C901
541563 scope = scope | {"pdl_context" : new_context }
542564 if requirements_satisfied is False :
543565 continue
544-
545- result = lazy_apply (id_with_set_first_use_nanos (block .pdl__timing ), result )
546- add_done_callback (
547- id_with_set_first_use_nanos (block .pdl__timing ), background
548- )
549- trace = trace .model_copy (update = {"pdl__result" : result })
550- if block .parser is not None :
551- parser_func = partial (parse_result , block .parser )
552- result = lazy_apply (parser_func , result )
553- if init_state .yield_result :
554- yield_result (result , block .kind )
555- if block .spec is not None and not isinstance (block , FunctionBlock ):
556- checker = partial (
557- result_with_type_checking ,
558- spec = block .spec ,
559- msg = "Type errors during spec checking:" ,
560- loc = append (loc , "spec" ),
561- trace = trace ,
562- )
563- result = lazy_apply (checker , result )
564- if block .fallback is not None :
565- result .result ()
566566 break
567567 except Exception as exc :
568568 err_msg = traceback .format_exc ()
0 commit comments