Skip to content

Conversation

@CatarinaGamboa
Copy link
Collaborator

Description

Primitive values had annotation of SHARED which would prevent us to add other primitive values in calls to Unique objects. Now they are IMMUTABLE, they could also be just PRIMITIVE that would mean the same.
This annotation is NOT available to be used, is used only internally to identify the permissions of these primitive variables.

Example

class PQNode{
    PQNode(int value, @Free PQNode next) {
        this.value = value;
        this.next = next;
    }

    int value;
    @Unique PQNode next;

    void insert(int v) {
        if (v < this.value) {
            PQNode nxt = this.next;
            this.next = null;
            PQNode newNode = new PQNode(this.value, nxt); // would be an error because this.value would be shared, now is possible and this example passes

Type of change

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

How Has This Been Tested?

Added a test

@CatarinaGamboa CatarinaGamboa merged commit dd9b62e into main Feb 1, 2026
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.

2 participants