aboutsummaryrefslogtreecommitdiff
path: root/notes/noreturn.txt
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@kodafritt.se>2026-03-22 20:52:47 +0100
committerSamuel Lidén Borell <samuel@kodafritt.se>2026-03-22 20:52:47 +0100
commitecba605382200d596517b1df53f1626ebb7a87dd (patch)
tree4e26f7f242280d14351148fc14dac96e23f27360 /notes/noreturn.txt
parent2132da38cbcb905448f8cfc73ff1ea33623ab09e (diff)
downloadslul-try2-main.tar.gz
slul-try2-main.zip
Notes: noreturn syntaxHEADmain
Diffstat (limited to 'notes/noreturn.txt')
-rw-r--r--notes/noreturn.txt40
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