From 1a3496b8c7f7fcd61cc34c13a5f8f3e3f8ed5f86 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Thu, 3 Jan 2019 05:36:58 +0000 Subject: [PATCH] Fix nested promises. --- src/runtime/boot.scm | 4 +--- tests/runtime/test-promise.scm | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/runtime/boot.scm b/src/runtime/boot.scm index ff5a7a5ef..33a226a8e 100644 --- a/src/runtime/boot.scm +++ b/src/runtime/boot.scm @@ -436,9 +436,7 @@ USA. (object-type? (ucode-type delayed) (cell-contents object)))) (define (make-promise object) - (if (promise? object) - object - (make-cell (system-pair-cons (ucode-type delayed) #t object)))) + (make-cell (system-pair-cons (ucode-type delayed) #t object))) (define (make-unforced-promise thunk) ;(guarantee thunk? thunk 'make-unforced-promise) diff --git a/tests/runtime/test-promise.scm b/tests/runtime/test-promise.scm index 0378b0167..703baba85 100644 --- a/tests/runtime/test-promise.scm +++ b/tests/runtime/test-promise.scm @@ -30,9 +30,7 @@ USA. (define-test 'force-force-delay-delay (lambda () - (expect-error - (lambda () - (assert-eqv (force (force (delay (delay 0)))) 0))))) + (assert-eqv (force (force (delay (delay 0)))) 0))) ;; Adapted from SRFI 45. -- 2.25.1