Open
Description
Running this code gives an address-sanitizer warning in clang as we're letting a reference leak out of it's scope (the string the ref point to is deleted when the let scope is exited)
(Debug.sanitize-addresses)
(load "Test.carp")
(use Test)
(deftest test
(assert-equal test
"Wow"
(let [s @"Wow"]
&s)
"Shouldn't compile"))
Doing the same outside a test does give the proper error
(defn main []
(IO.println (let [s @"Wow"]
&s)))
The reference '(let [s (String.copy "Wow")] (ref s))' (depending on the variable 's') isn't alive