Skip to content

Commit ff5af01

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 <matthew.khouzam@ericsson.com>
1 parent 3ede7a7 commit ff5af01

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/metadata

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)