Merge branch 'master' into rossendrijver/refaster-speed-up-bug-fix

This commit is contained in:
Rick Ossendrijver
2025-03-21 10:22:30 +01:00
30 changed files with 363 additions and 513 deletions

View File

@@ -305,14 +305,7 @@ final class SourceCodeTest {
@Override
public Description matchLiteral(LiteralTree tree, VisitorState state) {
// XXX: The character conversion is a workaround for the fact that `ASTHelpers#constValue`
// returns an `Integer` value for `char` constants.
return Optional.ofNullable(ASTHelpers.constValue(tree))
.map(
constant ->
ASTHelpers.isSubtype(ASTHelpers.getType(tree), state.getSymtab().charType, state)
? (char) (int) constant
: constant)
.map(constant -> describeMatch(tree, addComment(tree, constant, state)))
.orElse(Description.NO_MATCH);
}