diff --git a/lang/README.md b/lang/README.md index 509e3e13..9bff2ddd 100644 --- a/lang/README.md +++ b/lang/README.md @@ -626,6 +626,24 @@ main := fn(): uint { } ``` +#### returning_optional_issues +```hb +BMP := 0 + +get_format := fn(): ?uint { + return BMP +} + +main := fn(): uint { + fmt := get_format() + if fmt == null { + return 1 + } else { + return fmt + } +} +``` + #### inlining_issues ```hb main := fn(): void { diff --git a/lang/src/son.rs b/lang/src/son.rs index be6df458..ec653139 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -4595,5 +4595,6 @@ mod tests { overwrite_aliasing_overoptimization; more_if_opts; optional_from_eca; + returning_optional_issues; } }