Closed
Bug 1531623
Opened 7 years ago
Closed 7 years ago
Identifier conflicts involving typedefs are inscrutable
Categories
(Core :: DOM: Bindings (WebIDL), enhancement)
Core
DOM: Bindings (WebIDL)
Tracking
()
RESOLVED
FIXED
mozilla67
| Tracking | Status | |
|---|---|---|
| firefox67 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: bzbarsky)
Details
Attachments
(1 file)
If I try to parse this IDL:
typedef long foo;
typedef long foo;
I get an exception like so:
AttributeError: 'IDLTypedef' object has no attribute 'innerType'
This is not helpful. It happens because IDLTypedef.__init__ tries to resolve the identifier conflict before assigning self.innerType, but when that fails it tries to call __str__ in the IDLTypedef, which tries to use self.innerType.
We should either assign .innerType first or change __str__ to deal. If I do the assignment first, then for my testcase I get:
WebIDLError: error: Multiple unresolvable definitions of identifier 'foo' in scope '::
Typedef foo Long at <unknown> line 2:4
typedef long foo;
^
Typedef foo Long at <unknown> line 3:4
typedef long foo;
^
which is a lot nicer.
| Assignee | ||
Comment 1•7 years ago
|
||
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5ab896c5a05d
Fix webidl identifier conflicts involving typedefs to produce saner exceptions. r=qdot
Comment 3•7 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Updated•7 years ago
|
Assignee: nobody → bzbarsky
You need to log in
before you can comment on or make changes to this bug.
Description
•