From 4465307e09ecdbf4acbdc190b040607e6d2fe2a9 Mon Sep 17 00:00:00 2001 From: Jonah Jeleniewski Date: Thu, 3 Sep 2026 14:03:26 +1000 Subject: [PATCH 1/2] Make `hashCode` consistent with `equals` in `NameOccurrenceImpl` `image` was only used in `hashCode`. --- .../integradev/delphi/symbol/occurrence/NameOccurrenceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/delphi-frontend/src/main/java/au/com/integradev/delphi/symbol/occurrence/NameOccurrenceImpl.java b/delphi-frontend/src/main/java/au/com/integradev/delphi/symbol/occurrence/NameOccurrenceImpl.java index 195703c71..2412f2884 100644 --- a/delphi-frontend/src/main/java/au/com/integradev/delphi/symbol/occurrence/NameOccurrenceImpl.java +++ b/delphi-frontend/src/main/java/au/com/integradev/delphi/symbol/occurrence/NameOccurrenceImpl.java @@ -115,6 +115,7 @@ public boolean equals(Object o) { return isExplicitInvocation == that.isExplicitInvocation && isGeneric == that.isGeneric && location.equals(that.location) + && Objects.equals(image, that.image) && Objects.equals(declaration, that.declaration) && typeParameters.equals(that.typeParameters); } From daadccb923bf107b31fa3b064b7262c227b05c4f Mon Sep 17 00:00:00 2001 From: Jonah Jeleniewski Date: Thu, 3 Sep 2026 14:05:31 +1000 Subject: [PATCH 2/2] Simplify conditional expression in `TextLiteralNodeImpl::getType` --- .../delphi/antlr/ast/node/TextLiteralNodeImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/delphi-frontend/src/main/java/au/com/integradev/delphi/antlr/ast/node/TextLiteralNodeImpl.java b/delphi-frontend/src/main/java/au/com/integradev/delphi/antlr/ast/node/TextLiteralNodeImpl.java index 7712e76d1..f59ee1113 100644 --- a/delphi-frontend/src/main/java/au/com/integradev/delphi/antlr/ast/node/TextLiteralNodeImpl.java +++ b/delphi-frontend/src/main/java/au/com/integradev/delphi/antlr/ast/node/TextLiteralNodeImpl.java @@ -58,9 +58,8 @@ public Type getType() { boolean isSingleCharacter = (getValue().length() == 1); if (hasAnsiCharacterEscape()) { - return isSingleCharacter - ? getTypeFactory().getIntrinsic(IntrinsicType.ANSICHAR) - : getTypeFactory().getIntrinsic(IntrinsicType.ANSISTRING); + return getTypeFactory() + .getIntrinsic(isSingleCharacter ? IntrinsicType.ANSICHAR : IntrinsicType.ANSISTRING); } IntrinsicType intrinsic = isSingleCharacter ? IntrinsicType.CHAR : IntrinsicType.STRING;