Open Bug 666199 Opened 13 years ago Updated 2 years ago

Support method overloading in idl

Categories

(Core :: XPCOM, defect)

defect

Tracking

()

People

(Reporter: m_kato, Unassigned)

References

Details

This is a example.

http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#htmloptionscollection

interface HTMLOptionsCollection : HTMLCollection {
 ...
  void add(in HTMLElement element, in optional HTMLElement? before);
  void add(in HTMLElement element, in long before);
 ...
};

IDL has same name methods that the parameter is different.  When I write same IDL, XPIDL and pyIDL causes the error.

XPIDL
=====
c:/Workspace/hg.mozilla.org/mozilla-central/dom/interfaces/html/nsIDOMHTMLSelect
Element.idl:75: `add' conflicts
c:/Workspace/hg.mozilla.org/mozilla-central/dom/interfaces/html/nsIDOMHTMLSelect
Element.idl:72: with interface operation `add'

PyIDL
=====
xpidl.IDLError: error: name 'add' specified twice.  Previous location: ...


So we cannot implement select.add(element, index) and options.add(element, before)...
Blocks: 666200
Summary: XPIDL / PyIDL support same method name that parameter is different → xpidl / pyxpidl support same method name that parameter is different
Depends on: 660861
Summary: xpidl / pyxpidl support same method name that parameter is different → Support method overloading in idl
Should we dupe this bug to bug 691394? (which has more discussion)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.