@@ -2,7 +2,7 @@ use quote::quote_spanned;
22use syn:: parse_quote_spanned;
33
44use super :: {
5- DelayType , OperatorCategory , OperatorConstraints , OperatorWriteOutput , RANGE_0 , RANGE_1 ,
5+ OperatorCategory , OperatorConstraints , OperatorWriteOutput , RANGE_0 , RANGE_1 ,
66 WriteContextArgs ,
77} ;
88
@@ -42,7 +42,7 @@ pub const LATTICE_REDUCE: OperatorConstraints = OperatorConstraints {
4242 flo_type : None ,
4343 ports_inn : None ,
4444 ports_out : None ,
45- input_delaytype_fn : |_| Some ( DelayType :: MonotoneAccum ) ,
45+ input_delaytype_fn : |_| None ,
4646 write_fn : |wc @ & WriteContextArgs {
4747 root,
4848 inputs,
@@ -51,8 +51,6 @@ pub const LATTICE_REDUCE: OperatorConstraints = OperatorConstraints {
5151 ..
5252 } ,
5353 diagnostics| {
54- assert ! ( is_pull) ;
55-
5654 let arguments = & parse_quote_spanned ! { op_span=>
5755 |acc, item| { #root:: lattices:: Merge :: <_>:: merge( acc, item) ; }
5856 } ;
@@ -68,24 +66,27 @@ pub const LATTICE_REDUCE: OperatorConstraints = OperatorConstraints {
6866 write_tick_end,
6967 } = ( super :: reduce:: REDUCE . write_fn ) ( & wc, diagnostics) ?;
7068
71- assert_eq ! ( 1 , inputs. len( ) ) ;
72- let input = & inputs[ 0 ] ;
73-
74- let write_iterator = quote_spanned ! { op_span=>
75- let #input = {
76- #[ inline( always) ]
77- fn check_inputs<Lat , Prev >(
78- input: Prev ,
79- ) -> impl #root:: dfir_pipes:: pull:: Pull <Item = Lat , Meta = Prev :: Meta , CanPend = Prev :: CanPend , CanEnd = Prev :: CanEnd >
80- where
81- Lat : #root:: lattices:: Merge <Lat >,
82- Prev : #root:: dfir_pipes:: pull:: Pull <Item = Lat >,
83- {
84- input
85- }
86- check_inputs( #input)
87- } ;
88- #write_iterator
69+ let write_iterator = if is_pull {
70+ assert_eq ! ( 1 , inputs. len( ) ) ;
71+ let input = & inputs[ 0 ] ;
72+ quote_spanned ! { op_span=>
73+ let #input = {
74+ #[ inline( always) ]
75+ fn check_inputs<Lat , Prev >(
76+ input: Prev ,
77+ ) -> impl #root:: dfir_pipes:: pull:: Pull <Item = Lat , Meta = Prev :: Meta , CanPend = Prev :: CanPend , CanEnd = Prev :: CanEnd >
78+ where
79+ Lat : #root:: lattices:: Merge <Lat >,
80+ Prev : #root:: dfir_pipes:: pull:: Pull <Item = Lat >,
81+ {
82+ input
83+ }
84+ check_inputs( #input)
85+ } ;
86+ #write_iterator
87+ }
88+ } else {
89+ write_iterator
8990 } ;
9091 Ok ( OperatorWriteOutput {
9192 write_prologue,
0 commit comments