@@ -1448,7 +1448,7 @@ remains blocked:
14481448 self .set_pending(inst, dst_buffer, on_copy, on_copy_done)
14491449 else :
14501450 assert (self .t == dst_buffer.t == self .pending_buffer.t)
1451- trap_if(inst is self .pending_inst and not none_or_number_type (self .t)) # temporary
1451+ trap_if(inst is self .pending_inst and not none_or_primitive_type (self .t)) # temporary
14521452 if self .pending_buffer.remain() > 0 :
14531453 if dst_buffer.remain() > 0 :
14541454 n = min (dst_buffer.remain(), self .pending_buffer.remain())
@@ -1460,7 +1460,7 @@ remains blocked:
14601460 self .set_pending(inst, dst_buffer, on_copy, on_copy_done)
14611461```
14621462Currently, there is a trap when both the ` read ` and ` write ` come from the same
1463- component instance and there is a non-empty, non-number element type. This trap
1463+ component instance and there is a non-empty, non-primitive element type. This trap
14641464will be removed in a subsequent release; the reason for the trap is that when
14651465lifting and lowering can alias the same memory, interleavings can be complex
14661466and must be handled carefully. Future improvements to the Canonical ABI ([ lazy
@@ -1482,7 +1482,7 @@ pending:
14821482 self .set_pending(inst, src_buffer, on_copy, on_copy_done)
14831483 else :
14841484 assert (self .t == src_buffer.t == self .pending_buffer.t)
1485- trap_if(inst is self .pending_inst and not none_or_number_type (self .t)) # temporary
1485+ trap_if(inst is self .pending_inst and not none_or_primitive_type (self .t)) # temporary
14861486 if self .pending_buffer.remain() > 0 :
14871487 if src_buffer.remain() > 0 :
14881488 n = min (src_buffer.remain(), self .pending_buffer.remain())
@@ -1505,13 +1505,14 @@ notifying the reader end and allowing it to rendezvous with a non-zero-length
15051505` read ` and make progress. See the [ stream readiness] section in the async
15061506explainer for more background on purpose of zero-length reads and writes.
15071507
1508- The ` none_or_number_type ` predicate used above includes both the integer and
1508+ The ` none_or_primitive_type ` predicate used above includes both the integer and
15091509floating point number types:
15101510``` python
1511- def none_or_number_type (t ):
1511+ def none_or_primitive_type (t ):
15121512 return t is None or isinstance (t, U8Type | U16Type | U32Type | U64Type |
15131513 S8Type | S16Type | S32Type | S64Type |
1514- F32Type | F64Type)
1514+ F32Type | F64Type |
1515+ BoolType | CharType)
15151516```
15161517
15171518The two ends of a stream are stored as separate elements in the component
@@ -1657,7 +1658,7 @@ end was dropped before receiving a value.
16571658 if not self .pending_buffer:
16581659 self .set_pending(inst, dst_buffer, on_copy_done)
16591660 else :
1660- trap_if(inst is self .pending_inst and not none_or_number_type (self .t)) # temporary
1661+ trap_if(inst is self .pending_inst and not none_or_primitive_type (self .t)) # temporary
16611662 dst_buffer.write(self .pending_buffer.read(1 ))
16621663 self .reset_and_notify_pending(CopyResult.COMPLETED )
16631664 on_copy_done(CopyResult.COMPLETED )
@@ -1669,7 +1670,7 @@ end was dropped before receiving a value.
16691670 elif not self .pending_buffer:
16701671 self .set_pending(inst, src_buffer, on_copy_done)
16711672 else :
1672- trap_if(inst is self .pending_inst and not none_or_number_type (self .t)) # temporary
1673+ trap_if(inst is self .pending_inst and not none_or_primitive_type (self .t)) # temporary
16731674 self .pending_buffer.write(src_buffer.read(1 ))
16741675 self .reset_and_notify_pending(CopyResult.COMPLETED )
16751676 on_copy_done(CopyResult.COMPLETED )
0 commit comments