From dc874f299474de6a4b9e4e34e78d999c4d13a0c9 Mon Sep 17 00:00:00 2001 From: lyken Date: Thu, 13 Jun 2024 16:58:32 +0800 Subject: [PATCH] core: use `PrimDef` simple names in make_primitives() --- nac3core/src/toplevel/helper.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nac3core/src/toplevel/helper.rs b/nac3core/src/toplevel/helper.rs index b8d56898..154740b7 100644 --- a/nac3core/src/toplevel/helper.rs +++ b/nac3core/src/toplevel/helper.rs @@ -387,9 +387,9 @@ impl TopLevelComposer { let option = unifier.add_ty(TypeEnum::TObj { obj_id: PrimDef::Option.id(), fields: vec![ - ("is_some".into(), (is_some_type_fun_ty, true)), - ("is_none".into(), (is_some_type_fun_ty, true)), - ("unwrap".into(), (unwrap_fun_ty, true)), + (PrimDef::OptionIsSome.simple_name().into(), (is_some_type_fun_ty, true)), + (PrimDef::OptionIsNone.simple_name().into(), (is_some_type_fun_ty, true)), + (PrimDef::OptionUnwrap.simple_name().into(), (unwrap_fun_ty, true)), ] .into_iter() .collect::>(), @@ -429,8 +429,8 @@ impl TopLevelComposer { let ndarray = unifier.add_ty(TypeEnum::TObj { obj_id: PrimDef::NDArray.id(), fields: Mapping::from([ - ("copy".into(), (ndarray_copy_fun_ty, true)), - ("fill".into(), (ndarray_fill_fun_ty, true)), + (PrimDef::NDArrayCopy.simple_name().into(), (ndarray_copy_fun_ty, true)), + (PrimDef::NDArrayFill.simple_name().into(), (ndarray_fill_fun_ty, true)), ]), params: VarMap::from([ (ndarray_dtype_tvar.1, ndarray_dtype_tvar.0),