optional from eca test
This commit is contained in:
parent
87cb77a553
commit
d3ee72306e
|
@ -614,6 +614,18 @@ main := fn(): uint {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### optional_from_eca
|
||||||
|
```hb
|
||||||
|
main := fn(): uint {
|
||||||
|
a := @as(?uint, @eca(0, 0, 0, 0))
|
||||||
|
|
||||||
|
if a == null {
|
||||||
|
die
|
||||||
|
}
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
#### inlining_issues
|
#### inlining_issues
|
||||||
```hb
|
```hb
|
||||||
main := fn(): void {
|
main := fn(): void {
|
||||||
|
|
|
@ -4594,5 +4594,6 @@ mod tests {
|
||||||
global_aliasing_overptimization;
|
global_aliasing_overptimization;
|
||||||
overwrite_aliasing_overoptimization;
|
overwrite_aliasing_overoptimization;
|
||||||
more_if_opts;
|
more_if_opts;
|
||||||
|
optional_from_eca;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
3
lang/tests/son_tests_optional_from_eca.txt
Normal file
3
lang/tests/son_tests_optional_from_eca.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
test.hb:8:2: can't prove the value is not 'null', use '@unwrap(<opt>)' if you believe compiler is stupid, or explicitly check for null and handle it ('if <opt> == null { /* handle */ } else { /* use opt */ }')
|
||||||
|
return a
|
||||||
|
^
|
Loading…
Reference in a new issue