[webidl] "it is not possible for a single platform object to implement both interfaces" (#59)

Apparently two IDL interface types are distinguishable if all of the following hold

- The two identified interfaces are not the same
- It is not possible for a single platform object to implement both interfaces
- It is not the case that both are callback interfaces.

This second condition is very confusing. I can think of two possible interpretations:

### Interpretation A

```
[NoInterfaceObject] interface Foo {};
[NoInterfaceObject] interface Bar {};

interface Baz {};
Baz implements Foo;
Baz implements Bar;
```

Baz implements both Foo and Bar, so Foo and Bar are not distinguishable. (Contrapositive of the given statement.)

### Interpretation B

```
[NoInterfaceObject] interface Foo { readonly attribute x; };
[NoInterfaceObject] interface Bar { attribute x; };

interface Baz {};
Baz implements Foo;
Baz implements Bar; // not allowed
```

It is not possible to implement both Foo and Bar at the same time, so they are distinguishable.

### Discussion

Both of these interpretations kind of suck.

Interpretation A is a very nonlocal definition. To determine if A and B are distinguishable, you have to look at all interfaces in the web platform, and find out if any of them implement both A and B. (I think something that extends A and implements B would also work, or vice-versa.) This means A and B's distinguishability can change at any time.

Interpretation B is very implicit. It comes down to finding all places in the spec that prohibit implementing a given interface. In this case I found the condition

> For a given interface, there MUST NOT be any member defined on any of its consequential interfaces whose identifier is the same as any other member defined on any of those consequential interfaces or on the original interface itself. 

but there are others, e.g. the no-cycles condition.

Which is it? And, is this actually implementable, or implemented by existing binding layers?

---
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/59

Received on Sunday, 27 September 2015 15:36:45 UTC