summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorRyan Lahfa2024-04-16 23:49:47 +0200
committerRyan Lahfa2024-04-24 11:04:11 +0200
commit8b1fd2477148d5c7174b5175074d480b1cb2cf06 (patch)
tree37a98870f5e34ea87c903e2c39b1eff01695554c /compiler
parent18484e28ef7b13b95dc3af0b1e34c2181e1778e5 (diff)
compiler: map `core::option::Option::is_none` to `Option.isNone`
Our backend already have support for `isNone`, we just map it and filter out passing the actual type as it can be inferred via implicit types. Other backends than Lean are not done in this commit. Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ExtractBuiltin.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/ExtractBuiltin.ml b/compiler/ExtractBuiltin.ml
index 531f1d8b..c59825d1 100644
--- a/compiler/ExtractBuiltin.ml
+++ b/compiler/ExtractBuiltin.ml
@@ -294,6 +294,9 @@ let builtin_funs () : (pattern * bool list option * builtin_fun_info) list =
mk_fun "core::option::{core::option::Option<@T>}::take"
(Some (backend_choice "option::take" "Option::take"))
None;
+ mk_fun "core::option::{core::option::Option<@T>}::is_none"
+ (Some (backend_choice "option::is_none" "Option::isNone"))
+ (Some [ false ]);
mk_fun "alloc::vec::{alloc::vec::Vec<@T, alloc::alloc::Global>}::new"
(Some "alloc::vec::Vec::new") None;
mk_fun "alloc::vec::{alloc::vec::Vec<@T, @A>}::push" None
@@ -521,6 +524,7 @@ let builtin_fun_effects =
"core::mem::swap";
"core::mem::take";
"core::option::{core::option::Option<@T>}::take";
+ "core::option::{core::option::Option<@T>}::is_none";
"core::clone::impls::{core::clone::Clone<bool>}::clone";
"alloc::vec::{alloc::vec::Vec<@T, alloc::alloc::Global>}::with_capacity";
"core::slice::{[@T]}::reverse";