Support for function invocations as If conditions#28
Merged
Conversation
# Conflicts: # latte/src/test/java/AppTest.java
Collaborator
Author
|
@CatarinaGamboa a verificação do return type da função adequa-se, ou não vale a pena tendo em conta que já é checked pelo compiler? |
CatarinaGamboa
requested changes
Jun 13, 2025
| visitCtFieldRead((CtFieldRead<?>)condition); | ||
| } else if (condition instanceof CtInvocation) { | ||
| CtInvocation<?> invocation = (CtInvocation<?>) condition; | ||
| if (!invocation.getType().getQualifiedName().equals("boolean")) { |
Collaborator
There was a problem hiding this comment.
No need to check this as the Java compiler already performs this check
| } | ||
|
|
||
| public void test(@Free Object v1, boolean c1){ | ||
| if (boolRead(c1)) { |
Collaborator
There was a problem hiding this comment.
Now add more tests with methods that use the Objects with permissions like @Unique, and see if their changes are added to the context after the call.
Collaborator
Não é preciso fazermos porque estamos a trabalhar sobre o compilador de Java e por isso já sabemos que os tipos básicos fazem type check. |
CatarinaGamboa
approved these changes
Jun 16, 2025
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.
Description
Added support for function invocations in If conditions
Example
if (function(x)){ _logic_ }Related Issue
Closes #22
Type of change
How Has This Been Tested?
Added tests that verify the correct functionality