Diverging procedures proc() -> ! (no return)

This commit is contained in:
gingerBill
2018-09-08 12:16:03 +01:00
parent 3cd6ae311d
commit 3825eab989
8 changed files with 37 additions and 6 deletions
+10
View File
@@ -785,6 +785,15 @@ bit_set_type :: proc() {
}
}
diverging_procedures :: proc() {
// Diverging procedures may never return
foo :: proc() -> ! {
fmt.println("I'm a diverging procedure");
}
foo();
}
main :: proc() {
when true {
@@ -800,5 +809,6 @@ main :: proc() {
cstring_example();
deprecated_attribute();
bit_set_type();
diverging_procedures();
}
}