Validate unique dictionary members (including inheritance)
foolip opened this issue · 4 comments
foolip commented
https://heycam.github.io/webidl/#idl-dictionaries says:
The identifier of a dictionary member must not be the same as that of another dictionary member defined on the dictionary or on that dictionary’s inherited dictionaries.
I tried if webidl2.js would catch such errors but it seems like not:
const { parse, validate } = require("webidl2");
const ast = parse(`dictionary A { any m; }; dictionary B : A { object m; };`);
const validations = validate(ast); // returns []
foolip commented
It actually looks like duplicating the member name on a single dictionary is also not validated for.
foolip commented
I wrote up a quick check for this locally (in webref) but to my surprise there doesn't seem to be any duplicate member names currently.
saschanaz commented
Yeah, the current name check only applies for parent types, not members. Something to be done later.