Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Dictionary argument "options" without required members must be marked optional" misfires #3023

Open
domenic opened this issue Feb 5, 2025 · 0 comments

Comments

@domenic
Copy link
Collaborator

domenic commented Feb 5, 2025

Minimal repro:

<pre class="metadata">
Title: Writing Assistance APIs
Shortname: writing-assistance
Level: None
Status: CG-DRAFT
Group: webml
Repository: webmachinelearning/writing-assistance-apis
URL: https://webmachinelearning.github.io/writing-assistance-apis
Editor: Domenic Denicola, Google https://www.google.com/, d@domenic.me, https://domenic.me/
Abstract: A
</pre>

<xmp class="idl">
partial interface AI {
  readonly attribute AITranslatorFactory translator;
};

[Exposed=(Window,Worker), SecureContext]
interface AITranslatorFactory {
  Promise<undefined> create(AITranslatorCreateOptions options);
  Promise<undefined> availability(AITranslatorCreateCoreOptions options);
};

dictionary AITranslatorCreateCoreOptions {
  required DOMString sourceLanguage;
  required DOMString targetLanguage;
};

dictionary AITranslatorCreateOptions : AITranslatorCreateCoreOptions {
  AbortSignal signal;
  AICreateMonitorCallback monitor;
};
</xmp>

Error result:

FATAL ERROR: IDL ERROR LINE: 7 - Dictionary argument "options" without required members must be marked optional

(Note the unhelpful line number.)

Very strangely: removing the partial interface makes this go away.

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

No branches or pull requests

1 participant