From 66712f891adcb1ccdce20b6e0a3fe24f6e805706 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Tue, 4 Oct 2022 19:58:07 +0200 Subject: [PATCH] fix(utils): add callback type to do_or_fail See https://github.com/teal-language/tl/issues/569 --- src/awesomewm.d.tl/utils.tl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/awesomewm.d.tl/utils.tl b/src/awesomewm.d.tl/utils.tl index 6c48228..768af7f 100644 --- a/src/awesomewm.d.tl/utils.tl +++ b/src/awesomewm.d.tl/utils.tl @@ -56,8 +56,7 @@ function utils.sanitize_string(s: string): string end -- At some point, we should probably write a wrapper to make penlight's function work with pcalls. -local type Func = function(...: any): T | nil, string -function utils.do_or_fail(func: Func, ...: any): T +function utils.do_or_fail(func: function(...: any): (T | nil, string), ...: any): T local log = require "logger" local res, err = func(...)