Owned convention does not destroy variable after transferring ownership
Hello everybody! I am working on a project that has a small exercises to learn Mojo. Currently, I am working on value ownership section and was playing with a code below.
The issue I have is that this code compiles but to my understanding of owned and ownership operator it shouldn't.
If you take equivalent code for string, it has an error "a is not initialized":
For equivalent integer code:
It throws no error, and value of x is 1.
Can someone please explain if this behaviour is correct or am I missing something? Thank you.
The issue I have is that this code compiles but to my understanding of owned and ownership operator it shouldn't.
If you take equivalent code for string, it has an error "a is not initialized":
For equivalent integer code:
It throws no error, and value of x is 1.
Can someone please explain if this behaviour is correct or am I missing something? Thank you.
