diff options
author | Son Ho | 2022-05-15 21:30:49 +0200 |
---|---|---|
committer | Son Ho | 2022-05-15 21:30:49 +0200 |
commit | a25d820b6eb02f573ad2c274a35e3496a9dacd40 (patch) | |
tree | d491994904b8f57b4b5ed993f61cec2127ebe20c /tests/betree | |
parent | f8f07a3135e69529407dfd9359197cb09e78776f (diff) |
Treat integer casts in a general manner
Diffstat (limited to '')
-rw-r--r-- | tests/betree/Primitives.fst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/betree/Primitives.fst b/tests/betree/Primitives.fst index 77cf59aa..f73c8c09 100644 --- a/tests/betree/Primitives.fst +++ b/tests/betree/Primitives.fst @@ -145,6 +145,10 @@ let scalar_sub (#ty : scalar_ty) (x : scalar ty) (y : scalar ty) : result (scala let scalar_mul (#ty : scalar_ty) (x : scalar ty) (y : scalar ty) : result (scalar ty) = mk_scalar ty (x * y) +(** Cast an integer from a [src_ty] to a [tgt_ty] *) +let scalar_cast (#src_ty : scalar_ty) (tgt_ty : scalar_ty) (x : scalar src_ty) : result (scalar tgt_ty) = + mk_scalar tgt_ty x + /// The scalar types type isize : eqtype = scalar Isize type i8 : eqtype = scalar I8 |