Conversation
CatarinaGamboa
approved these changes
Feb 11, 2026
Collaborator
CatarinaGamboa
left a comment
There was a problem hiding this comment.
nice refactoring! But what if we have two ghosts from different classes like ArrayList.size and Stack.size? would there be a way to only show the full name if theere are more than 1?
Collaborator
Author
|
I think so, but in that case we need both methods, |
Collaborator
Author
|
I'll try to do that in another PR and leave this one open. |
Collaborator
Author
|
This seems to be a bit harder than I originally thought, so I'll do that in a follow-up PR in the future. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces the
toString()methods from the AST classes with thetoSimplifiedString()methods. This way, the error messages don't include the fully qualified names for ghosts, which improves their readability by reducing their verbosity.Example
Before
Refinement Error: #index_7 == 1 && java.util.ArrayList.size(#list_8) == java.util.ArrayList.size(#list_4) + 1 && java.util.ArrayList.size(#list_4) == 0 is not a subtype of 0 <= #index_7 && #index_7 < com.arraylist.ArrayListRefinements.size(#list_8)After
Refinement Error: #index_7 == 1 && size(#list_8) == size(#list_4) + 1 && size(#list_4) == 0 is not a subtype of 0 <= #index_7 && #index_7 < size(#list_8)