mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-04 01:25:04 +03:00
Bug example.
This commit is contained in:
parent
78f85d73c1
commit
83b8b1dbed
@ -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"))
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user