Bug example.

This commit is contained in:
Erik Svedäng 2020-05-05 15:48:56 +02:00
parent 78f85d73c1
commit 83b8b1dbed

View File

@ -156,10 +156,19 @@
;; set to [111], which is alive for the rest of the scope.
;; So the memory error inside (let ...) doesn't get detected since the
;; lifetime is alive before, during, and after its scope.
(defn f []
(=
&[111]
(let [xs &[222]]
xs)
;; (defn f []
;; (=
;; &[111]
;; (let [xs &[222]]
;; xs)
))
;; ))
;; Bug! (issue https://github.com/carp-lang/Carp/issues/570)
(defn returning-refs-from-match []
(println*
(match (Maybe.Just 1)
(Maybe.Just _) &@"hej"))
)