From 672248f4319a5cc31dbf03a1483cf22ccbebd956 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Tue, 9 Jan 2024 10:40:27 +0100 Subject: [PATCH] Get rid of trick with type parameter --- questionable/private/binderror.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/questionable/private/binderror.nim b/questionable/private/binderror.nim index d4b7df5..432c0c9 100644 --- a/questionable/private/binderror.nim +++ b/questionable/private/binderror.nim @@ -24,13 +24,13 @@ macro captureBindError*(error: var ref CatchableError, expression): auto = func error[T](option: Option[T]): ref CatchableError = newException(ValueError, "Option is set to `none`") -macro bindFailed*(expression; _: type = void) = +macro bindFailed*(expression: typed) = ## Called when a binding (=?) fails. ## Assigns an error to the error variable (specified in captureBindError()) ## when appropriate. - # This macro has a type parameter to ensure that the compiler does not - # expand it before it expands invocations of captureBindError(). + # The `expression` parameter is typed to ensure that the compiler does not + # expand bindFailed() before it expands invocations of captureBindError(). # check that we have an error variable on the stack if errorVariableNames.len > 0: