Skip to content

Commit 11f8269

Browse files
committed
Tidy CABI: rename one more field from 'results' to 'result'
1 parent e03923c commit 11f8269

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

design/mvp/CanonicalABI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3491,7 +3491,7 @@ wasm state and passes them to the caller via `Task.return_`:
34913491
async def canon_task_return(task, result_type, opts: LiftOptions, flat_args):
34923492
trap_if(not task.inst.may_leave)
34933493
trap_if(task.opts.sync)
3494-
trap_if(result_type != task.ft.results)
3494+
trap_if(result_type != task.ft.result)
34953495
trap_if(not LiftOptions.equal(opts, task.opts))
34963496
cx = LiftLowerContext(opts, task.inst, task)
34973497
result = lift_flat_values(cx, MAX_FLAT_PARAMS, CoreValueIter(flat_args), task.ft.result_type())
@@ -3502,7 +3502,7 @@ The `trap_if(task.opts.sync)` prevents `task.return` from being called by
35023502
synchronously-lifted functions (which return their value by returning from the
35033503
lifted core function).
35043504

3505-
The `trap_if(result_type != task.ft.results)` guard ensures that, in a
3505+
The `trap_if(result_type != task.ft.result)` guard ensures that, in a
35063506
component with multiple exported functions of different types, `task.return` is
35073507
not called with a mismatched result type (which, due to indirect control flow,
35083508
can in general only be caught dynamically).

design/mvp/canonical-abi/definitions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ class InstanceType(ExternType):
8585
@dataclass
8686
class FuncType(ExternType):
8787
params: list[tuple[str,ValType]]
88-
results: list[ValType|tuple[str,ValType]]
88+
result: list[ValType|tuple[str,ValType]]
8989
def param_types(self):
9090
return self.extract_types(self.params)
9191
def result_type(self):
92-
return self.extract_types(self.results)
92+
return self.extract_types(self.result)
9393
def extract_types(self, vec):
9494
if len(vec) == 0:
9595
return []
@@ -2119,7 +2119,7 @@ async def canon_backpressure_set(task, flat_args):
21192119
async def canon_task_return(task, result_type, opts: LiftOptions, flat_args):
21202120
trap_if(not task.inst.may_leave)
21212121
trap_if(task.opts.sync)
2122-
trap_if(result_type != task.ft.results)
2122+
trap_if(result_type != task.ft.result)
21232123
trap_if(not LiftOptions.equal(opts, task.opts))
21242124
cx = LiftLowerContext(opts, task.inst, task)
21252125
result = lift_flat_values(cx, MAX_FLAT_PARAMS, CoreValueIter(flat_args), task.ft.result_type())

0 commit comments

Comments
 (0)