diff options
| -rw-r--r-- | notes/noreturn.txt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/notes/noreturn.txt b/notes/noreturn.txt new file mode 100644 index 0000000..9d906b5 --- /dev/null +++ b/notes/noreturn.txt @@ -0,0 +1,40 @@ +noreturn functions +================== + +Syntax 1: ++ short + + func f + Int x + noreturn + code + ... + end + + +Syntax 2, special "NoReturn" type: +* Inspired by Python's type hints, but this would be a real type +* the "NoReturn" type can't be used elsewhere. +- one extra line + + func f + Int x + return + NoReturn + code + ... + end + + +Syntax 3, special "Never" type: +* Inspired by Python's type hints, but this would be a real type +- one extra line +- the "Never" type can't be used elsewhere, so it could be confusing. + + func f + Int x + return + Never + code + ... + end |
