Obsidian
Obsidian copied to clipboard
Don't transfer ownership to unowned references
Describe the bug When creating an Unowned reference to an Owned reference, the Owned reference loses ownership
To Reproduce
C@Owned ownedC = ... ;
C@Unowned unownedC = ownedC; // ownedC loses ownership
Expected behavior
ownedC should retain ownership, while unownedC remains an Unowned reference.
I think this is in preparation for annotation inference, in which case this will be the correct behavior. If we want to support this, we'll need a new operator.
I think it's likely we need to add a new operator for this.