From b26cb2b360fe7741bd9ffdf6a71f3da7acdfe867 Mon Sep 17 00:00:00 2001 From: David Mak Date: Wed, 6 Mar 2024 12:24:39 +0800 Subject: [PATCH] core: Express member func def IDs as offsets from class def ID --- nac3core/src/toplevel/builtins.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nac3core/src/toplevel/builtins.rs b/nac3core/src/toplevel/builtins.rs index 0b03f168..03cd922d 100644 --- a/nac3core/src/toplevel/builtins.rs +++ b/nac3core/src/toplevel/builtins.rs @@ -416,9 +416,9 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo { type_vars: vec![option_ty_var], fields: vec![], methods: vec![ - ("is_some".into(), is_some_ty.0, DefinitionId(11)), - ("is_none".into(), is_some_ty.0, DefinitionId(12)), - ("unwrap".into(), unwrap_ty.0, DefinitionId(13)), + ("is_some".into(), is_some_ty.0, DefinitionId(PRIMITIVE_DEF_IDS.option.0 + 1)), + ("is_none".into(), is_some_ty.0, DefinitionId(PRIMITIVE_DEF_IDS.option.0 + 2)), + ("unwrap".into(), unwrap_ty.0, DefinitionId(PRIMITIVE_DEF_IDS.option.0 + 3)), ], ancestors: vec![TypeAnnotation::CustomClass { id: PRIMITIVE_DEF_IDS.option,