mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-14 15:31:31 +00:00
Report if a function isn't guaranteed to return
This commit is contained in:
@ -29,3 +29,10 @@ export function ifThenElseBlock(n: i32): bool {
|
||||
|
||||
assert(ifThenElseBlock(0) == false);
|
||||
assert(ifThenElseBlock(1) == true);
|
||||
|
||||
export function ifAlwaysReturns(n: i32): bool {
|
||||
if (n)
|
||||
return true;
|
||||
else
|
||||
throw new Error("error");
|
||||
}
|
||||
|
Reference in New Issue
Block a user