1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-02 07:07:46 +00:00

Fix input-output signatures (#999)

Since 0.101.0 we will finally catch more illegal `def` signatures. As
the grammar for input/output types is rather restricted, this would
error otherwise
This commit is contained in:
Stefan Holderbach 2024-12-22 14:58:11 +01:00 committed by GitHub
parent be6411ef4a
commit ba13f5ca60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 15 additions and 15 deletions

View file

@ -26,7 +26,7 @@ export def create [thunk: any] {
# The parameter val must be either a terminating value or closure, which will get run until
# the terminating value is returned from the current closure which
# is returned from this function.
export def test [val: any] -> any {
export def test [val: any]: nothing -> any {
let cl = (create $val)
do $cl
}
@ -43,7 +43,7 @@ export def test [val: any] -> any {
# Explicitly bounces the trampoline over a recursive function without first
# creating a closure .
export def recurse [val: any] -> any {
export def recurse [val: any]: nothing -> any {
mut maybe_thunk = $val
while ($maybe_thunk | describe) == closure {
$maybe_thunk = (do $maybe_thunk)