Skip to content

Commit c3db7a0

Browse files
ctf: allow declaration scopes to check if the declaration is overlapping
Needed for expanding aliases Change-Id: I97039e706002602347cb6d06fbcfecbbd084b55d Signed-off-by: Matthew Khouzam <[email protected]>
1 parent e6cd5b3 commit c3db7a0

File tree

1 file changed

+2
-1
lines changed
  • ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/metadata

1 file changed

+2
-1
lines changed

ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/metadata/DeclarationScope.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ public void registerType(String name, IDeclaration declaration)
197197
*/
198198
public void registerIdentifier(String name, IDeclaration declaration) throws ParseException {
199199
/* Check if the type has been defined in the current scope */
200-
if (fIdentifiers.containsKey(name)) {
200+
IDeclaration iDeclaration = fIdentifiers.get(declaration);
201+
if (iDeclaration != null && !Objects.equals(iDeclaration, declaration)) {
201202
throw new ParseException("Identifier has already been defined:" + name); //$NON-NLS-1$
202203
}
203204

0 commit comments

Comments
 (0)