public static final class Stmt.Assert extends wybs.lang.SyntacticElement.Impl implements Stmt
assert e, where
e is a boolean expression. The following illustrates:
function abs(int x) -> int:
if x < 0:
x = -x
assert x >= 0
return x
Assertions are either statically checked by the verifier, or turned into
runtime checks.Stmt.Assert, Stmt.Assign, Stmt.Assume, Stmt.Break, Stmt.Case, Stmt.Continue, Stmt.Debug, Stmt.DoWhile, Stmt.Fail, Stmt.IfElse, Stmt.NamedBlock, Stmt.Return, Stmt.Skip, Stmt.Switch, Stmt.VariableDeclaration, Stmt.While| Constructor and Description |
|---|
Assert(Expr expr,
wybs.lang.Attribute... attributes)
Create a given assert statement.
|
Assert(String msg,
Expr expr,
Collection<wybs.lang.Attribute> attributes)
Create a given assert statement.
|
public Expr expr
public Assert(Expr expr, wybs.lang.Attribute... attributes)
expr - the asserted condition, which may not be null.attributes - public Assert(String msg, Expr expr, Collection<wybs.lang.Attribute> attributes)
expr - the asserted condition, which may not be null.attributes - Copyright © 2017. All rights reserved.