From 83b8b1dbed6cd8a3f967b487c56db5df76715be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Sved=C3=A4ng?= Date: Tue, 5 May 2020 15:48:56 +0200 Subject: [PATCH] Bug example. --- examples/bugs.carp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/examples/bugs.carp b/examples/bugs.carp index 2ec10ddb..64e7e2cd 100644 --- a/examples/bugs.carp +++ b/examples/bugs.carp @@ -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")) + )