diff --git a/lang/README.md b/lang/README.md index eed9235..5c7d021 100644 --- a/lang/README.md +++ b/lang/README.md @@ -1042,6 +1042,20 @@ main := fn(): uint { } ``` +#### null_check_test +```hb +main := fn(): unit { + ptr := @as(?^uint, null) + *ptr = 0 + + if ptr == null { + return 1 + } + + return *ptr +} +``` + ### Just Testing Optimizations #### const_folding_with_arg diff --git a/lang/src/son.rs b/lang/src/son.rs index fb8617f..900f704 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -4412,6 +4412,7 @@ mod tests { writing_into_string; request_page; tests_ptr_to_ptr_copy; + null_check_test; // Just Testing Optimizations; const_folding_with_arg;