Skip to content

Remove ImportError and restrict ResourceLimiter to class types - #393

Merged
kateinoigakukun merged 2 commits into
mainfrom
katei/instantiation-prep
Jul 29, 2026
Merged

Remove ImportError and restrict ResourceLimiter to class types#393
kateinoigakukun merged 2 commits into
mainfrom
katei/instantiation-prep

Conversation

@kateinoigakukun

@kateinoigakukun kateinoigakukun commented Jul 29, 2026

Copy link
Copy Markdown
Member

Part of the incremental upstreaming of Embedded Swift support (#357). Follows #391.

Two preparatory changes for the instantiation path:

  • Remove ImportError in favor of WasmKitError messages. Import-resolution and module-registration failures are ordinary instantiation errors, so they are reported as WasmKitError messages instead of maintaining a separate error type. Error messages are unchanged.
  • Restrict ResourceLimiter to class types. Embedded Swift supports only class-bound existentials, so the protocol is constrained to AnyObject. This keeps any ResourceLimiter usable on every platform with no generic parameters or per-configuration storage. DefaultResourceLimiter and the fuzzer's limiter become final classes.

Import-resolution and module-registration failures are ordinary
instantiation errors, so report them as WasmKitError messages instead of
maintaining a separate error type and a per-call-site wrapper.
Embedded Swift supports only class-bound existentials, so constrain the
protocol to AnyObject to keep using `any ResourceLimiter` on every
platform instead of introducing generic parameters or per-config storage.
@kateinoigakukun
kateinoigakukun force-pushed the katei/instantiation-prep branch from 54ad7a1 to 01a5bb0 Compare July 29, 2026 12:32
@kateinoigakukun kateinoigakukun changed the title Remove ImportError and make resource-limiter parameters generic Remove ImportError and restrict ResourceLimiter to class types Jul 29, 2026
@kateinoigakukun
kateinoigakukun added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit b25fff7 Jul 29, 2026
17 checks passed
@kateinoigakukun
kateinoigakukun deleted the katei/instantiation-prep branch July 29, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant