Closed msaelices closed 3 weeks ago
You can see it in the following screenshot:
Tested with the following snippet:
var s = String("ab") p = s.unsafe_ptr() c = chr(int(p.load())) print('Char: ', c)
❯ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"
❯ mojo --version mojo 2024.9.1305 (6ceeec48)
Ok, I think it's not an issue but the fact of the s string is freed when we are using the unsafe pointer, which is legit as the pointer is actually unsafe. The REPL retain the value of the string
s
Bug description
You can see it in the following screenshot:
Steps to reproduce
Tested with the following snippet:
System information