Skip to content

Conversation

@Pichers
Copy link
Collaborator

@Pichers Pichers commented May 13, 2025

Description

Simulated an "Else { skip; }" when no else expression is present in the original code.

Related Issue

Closes #11

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring

How Has This Been Tested?

Some simple feature tests were ran locally, with no found bugs

@Pichers Pichers requested a review from CatarinaGamboa May 13, 2025 22:59
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.

Add tests to our testsuit

@CatarinaGamboa
Copy link
Collaborator

Are there any news in this PR? @Pichers

@Pichers Pichers requested a review from CatarinaGamboa May 20, 2025 17:36
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.

Add some more test cases for using values after the if condition like:

this.value = n;
if (x){
    this.value = k;
}
return this.value;

@Pichers Pichers requested a review from CatarinaGamboa June 11, 2025 15:30
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.

These tests are better but still do not test what I tried to mention last time, see the comments in the PR

this.next = next;
}

public Object test(@Free Object v1, boolean c1){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Create at least one more separate test where we check if the return type has the permission required after the if conditions.
For the previous example check if the return is still @Unique for example (might need changes):

public @Unique Object test(@Free Object v1, boolean c1){
  Object n;
   n = new Object(); // n is free
  this.value = n; // should be fine
  if (c1){
      this.value = v1; // should be fine
  }
  return this.value; // is this.value still Unique?
}

This way we can check if the information in the context is the expected one.

@Pichers Pichers requested a review from CatarinaGamboa June 15, 2025 14:33
@Pichers Pichers self-assigned this Jun 15, 2025
@Pichers Pichers merged commit 3f3fa21 into main Jun 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for If-no-else

3 participants