Obsidian icon indicating copy to clipboard operation
Obsidian copied to clipboard

Don't transfer ownership to unowned references

Open pkoronkevich opened this issue 7 years ago • 2 comments

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.

pkoronkevich avatar Jul 31 '18 12:07 pkoronkevich

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.

mcoblenz avatar Jul 31 '18 13:07 mcoblenz

I think it's likely we need to add a new operator for this.

mcoblenz avatar Sep 24 '18 17:09 mcoblenz