You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function encapsulates the external type matching relation defined in the core specification. It allows for checking compatibility of external types when linking modules or validating imports against exports. The current implementation uses the exact matching rules from the core specification, but this function provides a single point for potential future extensions to the type system.
170
+
This function encapsulates the external type matching relation defined in the :ref:`Import Subtyping <match>` of the validation section, where the :math:`\vdashexterntypematch\externtype_1\matchesexterntype\externtype_2` judgment establishes compatibility between external types. This allows for explicit checking of type compatibility when linking modules or validating imports against exports.
171
171
172
172
.. index:: instantiation, module instance
173
173
.. _embed-module-instantiate:
@@ -263,16 +263,20 @@ Modules
263
263
264
264
4. For each :math:`\export_i` in :math:`\export^\ast` and corresponding :math:`\externtype'_i` in :math:`{\externtype'}^\ast`, do:
265
265
266
-
a. If :math:`\isdirectexport(\module, \export_i.\EDESC)`, then append the pair :math:`(\export_i.\ENAME, \externtype'_i)` to :math:`\X{result}`.
266
+
a. Let :math:`\import_j = \exportimport(\module, \export_i.\EDESC)`.
267
+
268
+
b. If :math:`\import_j = \epsilon`, then append the pair :math:`(\export_i.\ENAME, \externtype'_i)` to :math:`\X{result}`.
Copy file name to clipboardExpand all lines: document/core/syntax/modules.rst
+13-19Lines changed: 13 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -356,32 +356,26 @@ Each export is labeled by a unique :ref:`name <syntax-name>`.
356
356
Exportable definitions are :ref:`functions <syntax-func>`, :ref:`tables <syntax-table>`, :ref:`memories <syntax-mem>`, and :ref:`globals <syntax-global>`,
357
357
which are referenced through a respective descriptor.
358
358
359
-
A *direct export* is one where the export references a function, table, memory, or global instance that is defined within the module itself rather than being imported.
359
+
A *direct export* is one where the export references a function, table, memory, or global instance that is defined within the module itself rather than being imported.
360
360
361
361
An *indirect export* (or *re-export*) is one where the export references a function, table, memory, or global that the module imports.
362
362
363
-
The import corresponding to an export description is given by:
363
+
For an export :math:`\export` in module :math:`m`, the export is direct when :math:`\exportimport(m, \export.\EDESC) = \epsilon` and indirect otherwise, where
364
+
the import corresponding to an export description is defined by:
364
365
365
366
.. math::
366
-
\begin{array}{lllll}
367
-
\production{import for export} & \importforexport(m, \exportdesc) &=&
0 commit comments