Commit afb60220 authored by John van Groningen's avatar John van Groningen

add optional member in derive member from generic, the optional member is used...

add optional member in derive member from generic, the optional member is used by the derived generic function, instead of the member that is derived
parent eb1c5568
......@@ -190,12 +190,29 @@ where
has_to_be_checked (Yes ({copied_class_defs}, n_cached_dcl_mods)) {glob_module,glob_object}
= not (glob_module < n_cached_dcl_mods && glob_object < size copied_class_defs && copied_class_defs.[glob_object])
check_generic_default (DeriveDefault generic_ident _) module_index cs
check_generic_default (DeriveDefault generic_ident _ No) module_index cs
# (generic_index,cs) = get_generic_index generic_ident module_index cs
= (DeriveDefault generic_ident generic_index,cs)
= (DeriveDefault generic_ident generic_index No,cs)
check_generic_default (DeriveDefault generic_ident _ (Yes {igi_ident})) module_index cs
# (generic_index,cs) = get_generic_index generic_ident module_index cs
# (member_index,cs) = get_member_index igi_ident module_index cs
= (DeriveDefault generic_ident generic_index (Yes {igi_ident=igi_ident,igi_g_index=member_index}),cs)
check_generic_default me_default_implementation module_index cs
= (me_default_implementation,cs)
get_member_index :: !Ident !Index !*CheckState -> (!GlobalIndex, !*CheckState)
get_member_index {id_name,id_info} mod_index cs=:{cs_symbol_table}
# (ste, cs_symbol_table) = readPtr id_info cs_symbol_table
# cs & cs_symbol_table = cs_symbol_table
= case ste.ste_kind of
STE_Member
-> ({gi_module=mod_index,gi_index = ste.ste_index}, cs)
STE_Imported STE_Member mod_index
-> ({gi_module=mod_index,gi_index = ste.ste_index}, cs)
_
# cs & cs_error = checkError id_name "undefined class member" cs.cs_error
-> ({gi_module=NoIndex,gi_index = NoIndex}, cs)
:: InstanceSymbols =
{ is_type_defs :: !.{# CheckedTypeDef}
, is_class_defs :: !.{# ClassDef}
......@@ -318,7 +335,7 @@ where
= check_icl_instance_members (class_member_n+1) instance_member_n member_mod_index ins_members ins_member_types_and_functions class_members class_ident ins_pos ins_type
instance_types n_icl_functions new_instance_members member_defs type_defs icl_functions modules var_heap type_heaps cs
| ins_member.cim_ident == class_member.ds_ident
| icl_functions.[ins_member.cim_index].fun_body=:GenerateInstanceBody _
| icl_functions.[ins_member.cim_index].fun_body=:GenerateInstanceBody _ _
# ins_member_types_and_functions = GenerateInstanceMember class_member_n ins_member.cim_index ins_member_types_and_functions
# (instance_types,icl_functions,member_defs,type_defs,modules,var_heap,type_heaps,cs)
= add_generated_instance ins_member.cim_index class_member member_mod_index ins_type instance_types icl_functions member_defs type_defs modules var_heap type_heaps cs
......@@ -374,9 +391,9 @@ where
# (new_instance_member_ds,new_instance_member,cs)
= make_default_instance instance_type.st_arity mm_ident me_priority ins_pos class_member function_n cs
-> (new_instance_member_ds,new_instance_member,ins_member_types_and_functions,cs)
DeriveDefault generic_ident generic_index
DeriveDefault generic_ident generic_index optional_member_ident_global_index
# ins_member_types_and_functions = GenerateInstanceMember instance_member_n function_n ins_member_types_and_functions
# fun_body = GenerateInstanceBodyChecked generic_ident generic_index
# fun_body = GenerateInstanceBodyChecked generic_ident generic_index optional_member_ident_global_index
# (new_instance_member_ds,new_instance_member,cs)
= make_derived_default_instance instance_type.st_arity fun_body me_priority ins_pos class_member function_n cs
-> (new_instance_member_ds,new_instance_member,ins_member_types_and_functions,cs)
......@@ -400,9 +417,9 @@ where
# (new_instance_member_ds,new_instance_member,cs)
= make_default_instance instance_type.st_arity mm_ident me_priority ins_pos class_member n_icl_functions cs
-> (new_instance_member_ds,new_instance_member,ins_member_types_and_functions,cs)
DeriveDefault generic_ident generic_index
DeriveDefault generic_ident generic_index optional_member_ident_global_index
# ins_member_types_and_functions = GenerateInstanceMember instance_member_n n_icl_functions ins_member_types_and_functions
# fun_body = GenerateInstanceBodyChecked generic_ident generic_index
# fun_body = GenerateInstanceBodyChecked generic_ident generic_index optional_member_ident_global_index
# (new_instance_member_ds,new_instance_member,cs)
= make_derived_default_instance instance_type.st_arity fun_body me_priority ins_pos class_member n_icl_functions cs
-> (new_instance_member_ds,new_instance_member,ins_member_types_and_functions,cs)
......@@ -420,9 +437,13 @@ where
= getMemberDef member_mod_index class_member.ds_index x_main_dcl_module_n member_defs modules
(instance_type,type_defs,modules,var_heap,type_heaps,cs)
= make_class_member_instance_type ins_type me_type me_class_vars type_defs modules var_heap type_heaps cs
({fun_body=GenerateInstanceBody generic_ident},icl_functions) = icl_functions![ins_member_index]
({fun_body=GenerateInstanceBody generic_ident optional_member_ident},icl_functions) = icl_functions![ins_member_index]
(generic_index,cs) = get_generic_index generic_ident x_main_dcl_module_n cs
fun_body = GenerateInstanceBodyChecked generic_ident generic_index
optional_member_ident_global_index
= case optional_member_ident of
No -> No
Yes member_ident -> Yes {igi_ident=member_ident,igi_g_index={gi_module=0,gi_index=0}}
fun_body = GenerateInstanceBodyChecked generic_ident generic_index optional_member_ident_global_index
(fun,icl_functions) = icl_functions![ins_member_index];
fun & fun_body = fun_body, fun_arity = class_member.ds_arity, fun_priority = me_priority
icl_functions & [ins_member_index] = fun
......
......@@ -368,10 +368,27 @@ where
checkFunctionBodies GeneratedBody function_ident_for_errors e_input e_state e_info cs
= (GeneratedBody, [], e_state, e_info, cs)
//---> ("checkFunctionBodies: function to derive ", function_ident_for_errors)
checkFunctionBodies (GenerateInstanceBodyChecked generic_ident generic_index) function_ident_for_errors e_input e_state e_info cs
= (GenerateInstanceBodyChecked generic_ident generic_index, [], e_state, e_info, cs)
checkFunctionBodies (GenerateInstanceBody generic_ident) function_ident_for_errors e_input e_state e_info cs
= (GenerateInstanceBody generic_ident, [], e_state, e_info, cs)
checkFunctionBodies (GenerateInstanceBodyChecked generic_ident generic_index optional_member_ident_global_index) function_ident_for_errors e_input e_state e_info cs
# (optional_member_ident_global_index,cs)
= case optional_member_ident_global_index of
No
-> (No,cs)
Yes member_ident_global_index=:{igi_ident={id_info}}
# (entry, cs_symbol_table) = readPtr id_info cs.cs_symbol_table
cs & cs_symbol_table=cs_symbol_table
-> case entry of
{ste_kind=STE_Member,ste_index}
# member_ident_global_index & igi_g_index = {gi_module=e_input.ei_mod_index,gi_index=ste_index}
-> (Yes member_ident_global_index,cs)
{ste_kind=STE_Imported STE_Member mod_index,ste_index}
# member_ident_global_index & igi_g_index = {gi_module=mod_index,gi_index=ste_index}
-> (Yes member_ident_global_index,cs)
_
# cs & cs_error = checkError member_ident_global_index.igi_ident "undefined class member" cs.cs_error
-> (Yes member_ident_global_index,cs)
= (GenerateInstanceBodyChecked generic_ident generic_index optional_member_ident_global_index, [], e_state, e_info, cs)
checkFunctionBodies (GenerateInstanceBody generic_ident optional_member_ident) function_ident_for_errors e_input e_state e_info cs
= (GenerateInstanceBody generic_ident optional_member_ident, [], e_state, e_info, cs)
checkFunctionBodies _ function_ident_for_errors e_input=:{ei_expr_level,ei_mod_index} e_state=:{es_var_heap, es_fun_defs} e_info cs
= abort ("checkFunctionBodies " +++ toString function_ident_for_errors +++ "\n")
......
......@@ -164,7 +164,7 @@ getBelongingSymbols (Declaration {decl_kind=STE_Imported STE_Class def_mod_index
# default_member_indexes = createArray n_members -1
default_member_indexes & [class_member_n] = 0
-> add_more_default_class_member_macros (class_member_n+1) [|default_class_member_macro_ident_and_index] 1 default_member_indexes dcl_modules
DeriveDefault generic_ident generic_index
DeriveDefault generic_ident generic_index _
-> add_default_class_member_macros (class_member_n+1) dcl_modules
| size class_macro_members==0
= (BS_Members class_members,dcl_modules)
......@@ -181,7 +181,7 @@ getBelongingSymbols (Declaration {decl_kind=STE_Imported STE_Class def_mod_index
# default_class_members = [|default_class_member_macro_ident_and_index:default_class_members]
default_member_indexes & [class_member_n] = default_member_n
-> add_more_default_class_member_macros (class_member_n+1) default_class_members (default_member_n+1) default_member_indexes dcl_modules
DeriveDefault generic_ident generic_index
DeriveDefault generic_ident generic_index _
-> add_more_default_class_member_macros (class_member_n+1) default_class_members default_member_n default_member_indexes dcl_modules
# default_class_members = {default_class_member\\default_class_member<-reverse default_class_members}
= (BS_MembersAndMacros class_members class_macro_members default_member_indexes default_class_members,dcl_modules)
......
......@@ -233,10 +233,15 @@ where
compare_default_implementations NoMemberDefault NoMemberDefault = True
compare_default_implementations (MacroMemberDefault _) (MacroMemberDefault _) = True
compare_default_implementations (DeriveDefault generic_ident1 generic_index1) (DeriveDefault generic_ident2 generic_index2)
= generic_index1==generic_index2 && generic_ident1==generic_ident2
compare_default_implementations (DeriveDefault generic_ident1 generic_index1 optional_member_ident1) (DeriveDefault generic_ident2 generic_index2 optional_member_ident2)
= generic_index1==generic_index2 && generic_ident1==generic_ident2 && compare_optional_member_ident optional_member_ident1 optional_member_ident2
compare_default_implementations _ _ = False
compare_optional_member_ident No No = True
compare_optional_member_ident (Yes member_ident1) (Yes member_ident2)
= member_ident1.igi_ident==member_ident2.igi_ident && member_ident1.igi_g_index==member_ident2.igi_g_index
compare_optional_member_ident _ _ = False
sort_clas_macro_members class_macro_members
= sort [id_name \\ {mm_ident={id_name}}<-:class_macro_members]
......
......@@ -843,8 +843,11 @@ instance check_completeness MemberDef where
= check_completeness me_default_implementation cci (check_completeness me_type cci ccs)
instance check_completeness MemberDefault where
check_completeness (DeriveDefault generic_ident {gi_module,gi_index}) cci ccs
check_completeness (DeriveDefault generic_ident {gi_module,gi_index} No) cci ccs
= check_whether_ident_is_imported generic_ident gi_module gi_index STE_Generic cci ccs
check_completeness (DeriveDefault generic_ident {gi_module,gi_index} (Yes {igi_ident,igi_g_index})) cci ccs
# ccs = check_whether_ident_is_imported generic_ident gi_module gi_index STE_Generic cci ccs
= check_whether_ident_is_imported igi_ident igi_g_index.gi_module igi_g_index.gi_index STE_Member cci ccs
check_completeness _ _ ccs
= ccs
......
......@@ -2105,7 +2105,7 @@ generate_derived_instance :: !DclInstanceMemberTypeAndFunctions !{#ClassInstance
generate_derived_instance NoDclInstanceMemberTypes ins_members ins_type ins_pos ins_class_index main_module_n predefs ss
= ss
generate_derived_instance (GenerateInstanceMember member_i member_fun_i member_types_and_functions) ins_members ins_type ins_pos ins_class_index main_module_n predefs ss
# (GenerateInstanceBodyChecked generic_ident generic_index,ss) = ss!ss_funs.[member_fun_i].fun_body
# (GenerateInstanceBodyChecked generic_ident generic_index optional_member,ss) = ss!ss_funs.[member_fun_i].fun_body
# ({gen_type,gen_deps},ss) = ss!ss_modules.[generic_index.gi_module].com_generic_defs.[generic_index.gi_index]
| ss.ss_funs.[member_fun_i].fun_arity<>gen_type.st_arity
# ss & ss_error = reportError generic_ident.id_name ins_pos "arity of generic function and member not equal" ss.ss_error
......@@ -2113,46 +2113,62 @@ generate_derived_instance (GenerateInstanceMember member_i member_fun_i member_t
| not gen_deps=:[]
# ss & ss_error = reportError generic_ident.id_name ins_pos "deriving instances from generic with dependencies not implemented" ss.ss_error
= generate_derived_instance member_types_and_functions ins_members ins_type ins_pos ins_class_index main_module_n predefs ss
# type_index = case ins_type.it_types of
[TA {type_index} _] -> type_index
[TAS {type_index} _ _] -> type_index
_ -> {glob_module= -1,glob_object= -1}
| type_index.glob_module>=0
# ({tdi_gen_rep},ss) = ss!ss_td_infos.[type_index.glob_module, type_index.glob_object]
# gen_type_rep = getGenericTypeRep tdi_gen_rep
# (opt_member_symb_ident,ss)
= make_member_symb_ident optional_member gen_type.st_arity generic_ident member_i ins_class_index ins_pos ss
= case opt_member_symb_ident of
Yes member_symb_ident
# type_index = case ins_type.it_types of
[TA {type_index} _] -> type_index
[TAS {type_index} _ _] -> type_index
_ -> {glob_module= -1,glob_object= -1}
| type_index.glob_module>=0
# ({tdi_gen_rep},ss) = ss!ss_td_infos.[type_index.glob_module, type_index.glob_object]
# gen_type_rep = getGenericTypeRep tdi_gen_rep
# gen_type_rep & gtr_type = add_instance_calls_to_GenTypeStruct gen_type_rep.gtr_type member_symb_ident
# (TransformedBody {tb_args, tb_rhs}, ss)
= buildDerivedInstanceCaseBody gen_type_rep main_module_n ins_pos type_index generic_ident generic_index predefs ss
#! (arg_vars, local_vars, free_vars) = collectVars tb_rhs tb_args
| not free_vars=:[]
-> abort "generate_derived_instance: free_vars is not empty\n"
# (fun=:{fun_info},ss) = ss!ss_funs.[member_fun_i]
(ss_funs_and_groups=:{fg_group_index},ss) = ss!ss_funs_and_groups
fun &
fun_arity = length arg_vars,
fun_body = TransformedBody {tb_args=arg_vars, tb_rhs=tb_rhs},
fun_info = {fun_info &
fi_calls = collectCalls main_module_n tb_rhs,
fi_free_vars = [], fi_local_vars = local_vars, fi_group_index = fg_group_index,
fi_properties = fun_info.fi_properties bitor FI_GenericFun}
group = {group_members = [member_fun_i]}
ss_funs_and_groups & fg_group_index=fg_group_index+1,
fg_groups=[group:ss_funs_and_groups.fg_groups]
ss & ss_funs.[member_fun_i] = fun, ss_funs_and_groups = ss_funs_and_groups
-> generate_derived_instance member_types_and_functions ins_members ins_type ins_pos ins_class_index main_module_n predefs ss
-> generate_derived_instance member_types_and_functions ins_members ins_type ins_pos ins_class_index main_module_n predefs ss
No
-> generate_derived_instance member_types_and_functions ins_members ins_type ins_pos ins_class_index main_module_n predefs ss
where
make_member_symb_ident :: !(Optional IdentGlobalIndex) !Int !Ident !Int !GlobalIndex !Position !*SpecializeState -> *(!Optional SymbIdent,!*SpecializeState)
make_member_symb_ident No gen_arity generic_ident member_i ins_class_index ins_pos ss
# ({class_ident,class_members},ss) = ss!ss_modules.[ins_class_index.gi_module].com_class_defs.[ins_class_index.gi_index]
# {ds_ident,ds_index} = class_members.[member_i]
# member_symb_ident = {symb_ident=ds_ident,
symb_kind=SK_OverloadedFunction {glob_module=ins_class_index.gi_module,glob_object=ds_index}}
# gen_type_rep & gtr_type = add_instance_calls_to_GenTypeStruct gen_type_rep.gtr_type member_symb_ident
# (TransformedBody {tb_args, tb_rhs}, ss)
= buildDerivedInstanceCaseBody gen_type_rep main_module_n ins_pos type_index generic_ident generic_index predefs ss
#! (arg_vars, local_vars, free_vars) = collectVars tb_rhs tb_args
| not free_vars=:[]
= abort "generate_derived_instance: free_vars is not empty\n"
# (fun=:{fun_info},ss) = ss!ss_funs.[member_fun_i]
(ss_funs_and_groups=:{fg_group_index},ss) = ss!ss_funs_and_groups
fun &
fun_arity = length arg_vars,
fun_body = TransformedBody {tb_args=arg_vars, tb_rhs=tb_rhs},
fun_info = {fun_info &
fi_calls = collectCalls main_module_n tb_rhs,
fi_free_vars = [],
fi_local_vars = local_vars, fi_group_index = fg_group_index,
fi_properties = fun_info.fi_properties bitor FI_GenericFun}
group = {group_members = [member_fun_i]}
ss_funs_and_groups & fg_group_index=fg_group_index+1,
fg_groups=[group:ss_funs_and_groups.fg_groups]
ss & ss_funs.[member_fun_i] = fun, ss_funs_and_groups = ss_funs_and_groups
= generate_derived_instance member_types_and_functions ins_members ins_type ins_pos ins_class_index main_module_n predefs ss
= generate_derived_instance member_types_and_functions ins_members ins_type ins_pos ins_class_index main_module_n predefs ss
= (Yes member_symb_ident,ss)
make_member_symb_ident (Yes {igi_g_index}) gen_arity generic_ident member_i ins_class_index ins_pos ss
# ({me_type,me_ident},ss) = ss!ss_modules.[igi_g_index.gi_module].com_member_defs.[igi_g_index.gi_index]
| me_type.st_arity<>gen_arity
# ss & ss_error = reportError generic_ident.id_name ins_pos "arity of generic function and member not equal" ss.ss_error
= (No,ss)
# member_symb_ident = {symb_ident=me_ident,
symb_kind=SK_OverloadedFunction {glob_module=igi_g_index.gi_module,glob_object=igi_g_index.gi_index}}
= (Yes member_symb_ident,ss)
add_instance_calls_to_GenTypeStruct :: !GenTypeStruct SymbIdent -> GenTypeStruct
add_instance_calls_to_GenTypeStruct (GTSPair gts1 gts2) member_symb_ident
......
......@@ -1700,7 +1700,7 @@ wantInstanceDeclaration parseContext pi_pos pState
# (member_ident, pState) = stringToIdent class_name IC_Expression pState
# (generic_ident, pState) = stringToIdent generic_function_name IC_Generic pState
# pState = wantEndOfDefinition "derive instance" pState
-> (PD_Instance {pim_pi = pi, pim_members = [PD_DeriveInstanceMember pi_pos member_ident generic_ident]}, pState)
-> (PD_Instance {pim_pi = pi, pim_members = [PD_DeriveInstanceMember pi_pos member_ident generic_ident No]}, pState)
_
# pState = parseError "derive instance member" (Yes token) "generic function name" pState
-> (PD_Instance {pim_pi = pi, pim_members = []}, pState)
......@@ -2220,8 +2220,15 @@ wantDeriveInstanceDefinition parseContext pos pState
-> case token of
IdentToken generic_function_name
# (generic_ident, pState) = stringToIdent generic_function_name IC_Generic pState
# pState = wantEndOfDefinition "derive instance" pState
-> (PD_DeriveInstanceMember pos member_ident generic_ident,pState)
# (token, pState) = nextToken FunctionContext pState
-> case token of
IdentToken member_name2
# (member_ident2, pState) = stringToIdent member_name2 IC_Expression pState
# pState = wantEndOfDefinition "derive instance" pState
-> (PD_DeriveInstanceMember pos member_ident generic_ident (Yes member_ident2),pState)
token
# pState = wantEndOfDefinition "derive instance" (tokenBack pState)
-> (PD_DeriveInstanceMember pos member_ident generic_ident No,pState)
_
# pState = parseError "derive instance member" (Yes token) "generic function name" pState
-> (PD_Erroneous,pState)
......
......@@ -376,7 +376,7 @@ instance collectFunctions FunDef where
collectFunctions fun_def=:{fun_body = ParsedBody bodies} icl_module ca
# (bodies, ca) = collectFunctions bodies icl_module ca
= ({fun_def & fun_body = ParsedBody bodies}, ca)
collectFunctions fun_def=:{fun_body = GenerateInstanceBody _} icl_module ca
collectFunctions fun_def=:{fun_body = GenerateInstanceBody _ _} icl_module ca
= (fun_def, ca)
instance collectFunctions ParsedBody where
......@@ -1544,10 +1544,17 @@ where
| bodies=:[]
# type & st_context = [type_context : st_context]
= case defs of
[PD_DeriveInstanceMember pos member_ident generic_ident:defs]
[PD_DeriveInstanceMember pos member_ident generic_ident optional_member_ident:defs]
| member_ident.id_name==name.id_name
# default_implementation
= case optional_member_ident of
No
-> DeriveDefault generic_ident {gi_module=NoIndex,gi_index=NoIndex} No
Yes member_ident
# no_index = {gi_module=NoIndex,gi_index=NoIndex}
-> DeriveDefault generic_ident no_index (Yes {igi_ident=member_ident,igi_g_index=no_index})
# mem_def = { me_ident = name, me_type = type, me_pos = pos, me_priority = prio,
me_default_implementation = DeriveDefault generic_ident {gi_module=NoIndex,gi_index=NoIndex},
me_default_implementation = default_implementation,
me_offset = NoIndex, me_class_vars = [], me_class = {glob_module = NoIndex, glob_object = NoIndex}, me_type_ptr = nilPtr }
(mem_defs,mem_macros,default_members_without_type,macro_members,new_macro_count,ca)
= check_symbols_of_class_members defs type_context macro_count ca
......@@ -1609,7 +1616,7 @@ where
macro = MakeNewImpOrDefFunction macro_ident fun_arity bodies FK_Macro prio No fun_pos
macro_member = {mm_ident=macro_ident,mm_index=macro_count}
-> (mem_defs,[macro : mem_macros],[(name,macro_member,fun_pos) : default_members_without_type],macro_members,new_macro_count,ca)
check_symbols_of_class_members [PD_DeriveInstanceMember pos _ _ : defs] type_context macro_count ca
check_symbols_of_class_members [PD_DeriveInstanceMember pos _ _ _ : defs] type_context macro_count ca
= check_symbols_of_class_members defs type_context macro_count (postParseError pos "member type missing" ca)
check_symbols_of_class_members [def : _] type_context macro_count ca
= abort "postparse.check_symbols_of_class_members: unknown def" // <<- def
......@@ -1673,8 +1680,8 @@ where
-> ([ fun : fun_defs ], ca)
_
-> collect_member_instances defs (postParseError fun_pos "function body expected" ca)
collect_member_instances [PD_DeriveInstanceMember pos member_ident generic_ident : defs] ca
# fun_body = GenerateInstanceBody generic_ident
collect_member_instances [PD_DeriveInstanceMember pos member_ident generic_ident optional_member_ident : defs] ca
# fun_body = GenerateInstanceBody generic_ident optional_member_ident
fun_def = {fun_ident = member_ident, fun_arity = 0, fun_priority = NoPrio, fun_type = No, fun_kind = FK_Function False,
fun_body = fun_body, fun_pos = pos, fun_lifted = 0, fun_info = EmptyFunInfo }
(fun_defs, ca) = collect_member_instances defs ca
......
......@@ -271,7 +271,7 @@ cIsNotAFunction :== False
| PD_Generic GenericDef
| PD_GenericCase GenericCaseDef Ident
| PD_Derive [GenericCaseDef]
| PD_DeriveInstanceMember Position Ident Ident
| PD_DeriveInstanceMember Position Ident Ident (Optional Ident)
| PD_Erroneous
:: FunKind = FK_Function !Bool | FK_Macro | FK_Caf | FK_NodeDefOrFunction | FK_Unknown
......@@ -401,7 +401,10 @@ cNameLocationDependent :== True
:: ClassDefInfos :== {# .{! [TypeKind]}}
:: MemberDefault = NoMemberDefault | MacroMemberDefault !MacroMember | DeriveDefault !Ident !GlobalIndex
:: MemberDefault
= NoMemberDefault
| MacroMemberDefault !MacroMember
| DeriveDefault !Ident !GlobalIndex !(Optional IdentGlobalIndex)
:: MemberDef =
{ me_ident :: !Ident
......@@ -722,10 +725,12 @@ FI_FusedMember :== 512 // used in module trans to mark fused versions of insta
| TransformedBody !TransformedBody
| Expanding ![FreeVar] // the parameters of the newly generated function
| GeneratedBody // the body will be generated automatically - for generics
| GenerateInstanceBody !Ident
| GenerateInstanceBodyChecked !Ident !GlobalIndex
| GenerateInstanceBody !Ident !(Optional Ident)
| GenerateInstanceBodyChecked !Ident !GlobalIndex !(Optional IdentGlobalIndex)
| NoBody
:: IdentGlobalIndex = { igi_ident :: !Ident, igi_g_index :: !GlobalIndex }
:: FunDef =
{ fun_ident :: !Ident
, fun_arity :: !Int
......
......@@ -1304,7 +1304,7 @@ partitionate_function mod_index max_fun_nr fun_index pi ps
GeneratedBody
// do not allocate a group, it will be allocated during the generic phase
-> (max_fun_nr, ps)
GenerateInstanceBodyChecked _ _
GenerateInstanceBodyChecked _ _ _
// do not allocate a group, it will be allocated during the generic phase
-> (max_fun_nr, ps)
......@@ -1338,7 +1338,7 @@ partitionate_called_function mod_index max_fun_nr fun_index pi ps
GeneratedBody
// do not allocate a group, it will be allocated during the generic phase
-> (max_fun_nr, ps)
GenerateInstanceBodyChecked _ _
GenerateInstanceBodyChecked _ _ _
// do not allocate a group, it will be allocated during the generic phase
-> (max_fun_nr, ps)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment