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:
parent
be6411ef4a
commit
ba13f5ca60
10 changed files with 15 additions and 15 deletions
|
@ -43,7 +43,7 @@ use tramp.nu
|
|||
# This version just returns either the value or a thunk.
|
||||
# Meant to be used in a trampoline
|
||||
# But still uses APS
|
||||
def fact [n: int, acc=1] -> int {
|
||||
def fact [n: int, acc=1]: nothing -> int {
|
||||
if $n <= 1 { return $acc } else {
|
||||
{|| fact ($n - 1) ($n * $acc) } # The thunk being returned to the trampoline
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue