Skip to content

Conversation

@rcosta358
Copy link
Collaborator

@rcosta358 rcosta358 commented Nov 6, 2025

This PR is similar to #63.
There was a problem where this simple program failed parsing:

public class Example {
    void example() {
        System.out.println("Hello, " + "World!");
    }
}
Syntax error with message
Found 1 error, with the message:
* Error in no viable alternative at input 'Hello,', in the position 5

This was because strings were not being handled in the binary operations, in this case string concatenation.
It was fixed by skipping string literals in the OperationsChecker.

@rcosta358 rcosta358 self-assigned this Nov 6, 2025
@rcosta358 rcosta358 added the bug Something isn't working label Nov 6, 2025
@alcides
Copy link
Collaborator

alcides commented Nov 6, 2025

FYI, o SMT tem um suporte limitado para string e concatenação de strings (e tamanho de strings).

Tal como 1 é selfified para {x:Int | x == 1}, "ola" devia ser selfified para {x:String | x == "ola"}.

Imagino que o Z3 Java tenha um binding correspondente.

Copy link
Collaborator

@CatarinaGamboa CatarinaGamboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! What a strange error 😅

@rcosta358 rcosta358 merged commit 57ccfcc into liquid-java:main Nov 8, 2025
1 check passed
@rcosta358 rcosta358 deleted the skip-strings branch November 8, 2025 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants