summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorJulius Ikkala <julius.ikkala@gmail.com>2025-04-07 06:08:29 +0300
committerGitHub <noreply@github.com>2025-04-06 20:08:29 -0700
commit1b82501dd0c74347cda4a2c7fe5a84fd610bb485 (patch)
treef283a491e0545aa6b890a988ac9fb14f192b4663 /docs
parent680fb0b4e9cbb65d46677183a3f68630be1f6179 (diff)
Add defer statement (#6619)
Diffstat (limited to 'docs')
-rw-r--r--docs/user-guide/02-conventional-features.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/user-guide/02-conventional-features.md b/docs/user-guide/02-conventional-features.md
index aaeea4114..5c15986f8 100644
--- a/docs/user-guide/02-conventional-features.md
+++ b/docs/user-guide/02-conventional-features.md
@@ -435,6 +435,12 @@ Slang supports the following statement forms with nearly identical syntax to HLS
* `return` statements
+* `defer` statements
+
+> #### Note ####
+> The `defer` statement in Slang is tied to scope. The deferred statement runs at the end of the scope like in Swift, not just at the end of the function like in Go.
+> `defer` supports but does not require block statements: both `defer f();` and `defer { f(); g(); }` are legal.
+
> #### Note ####
> Slang does not support the C/C++ `goto` keyword.