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.
Bug 1531623 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
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.