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

Validate that overloaded operations are distinguishable #651

Open
tidoust opened this issue Jan 31, 2022 · 4 comments
Open

Validate that overloaded operations are distinguishable #651

tidoust opened this issue Jan 31, 2022 · 4 comments

Comments

@tidoust
Copy link
Member

tidoust commented Jan 31, 2022

Web IDL defines a set of rules to assert whether two types are distinguishable, and thus whether a definition that includes overloaded operations is valid. These rules are not checked yet.

This gets a mention in #484 (comment) as "I'd consider that a separate issue", but since I could not spot a separate issue, I thought I'd create one ;)

@saschanaz
Copy link
Member

I believe this is for webref, but currently I had to turn off no-duplicate since it's not straightforward to decide which spec to blame when it happens. Do you have a good idea? 🤔

@tidoust
Copy link
Member Author

tidoust commented Feb 2, 2022

I'm not sure I get the no-duplicate comment? We should no longer have duplicate names in the curated data (and released NPM packages) of webref in particular.

For context, the starting point here was the Autoplay Policy Detection spec, see w3c/autoplay#21

On top of creating non distinguishable overloads, the approach that was envisioned in the spec turned out to be a bad one in any case but the point is that may be useful to validate the rules even when looking at a single spec.

@saschanaz
Copy link
Member

saschanaz commented Feb 20, 2022

Weird, I see several duplicates (not from webref but crawled with browser-specs):

Ignoring validation "no-duplicate" from portals. Details:
Validation error at line 2 in portals,4, inside `typedef MessageEventSource`:
 or HTMLPortalElement or PortalHost) MessageEventSource;
                                     ^ The name "MessageEventSource" of type "typedef" was already seen
Ignoring validation "no-duplicate" from permissions. Details:
Validation error at line 8 in permissions,2, inside `enum PermissionState`:
          enum PermissionState {
               ^ The name "PermissionState" of type "enum" was already seen
Ignoring validation "no-duplicate" from web-animations-1. Details:
Validation error at line 1 in web-animations-1,8, inside `enum FillMode`:
enum FillMode { "none", "forwards"
     ^ The name "FillMode" of type "enum" was already seen
Ignoring validation "no-duplicate" from web-animations-1. Details:
Validation error at line 2 in web-animations-1,22, inside `interface AnimationPlaybackEvent`:interface AnimationPlaybackEvent : Event {
          ^ The name "AnimationPlaybackEvent" of type "interface" was already seen
Ignoring validation "no-duplicate" from web-animations-1. Details:
Validation error at line 7 in web-animations-1,22, inside `dictionary AnimationPlaybackEventInit`:
dictionary AnimationPlaybackEventInit : EventInit {
           ^ The name "AnimationPlaybackEventInit" of type "dictionary" was already seen 

@tidoust
Copy link
Member Author

tidoust commented Feb 21, 2022

Ah, if you run the crawl yourself, you'll have to fix the specs yourself too ;)

I was only talking about the curated data in webref, where curation refers to applying a set of Web IDL patches to the crawled Web IDL extracts in order to pass Web IDL validation. These patches currently include a patch for the Portals spec and the other examples you mentioned to get rid of duplicates.

Patches need to be maintained manually, especially for duplicates where there is indeed no simple way to decide which spec to blame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants