Commit f1a2cbc1 authored by Artem Alimarine's avatar Artem Alimarine
Browse files

Fixes to compile with 2.0

parent 35709c98
......@@ -870,11 +870,23 @@ checkExpression free_vars (PE_Generic id=:{id_name,id_info} kind) e_input e_stat
-> (!Expression, ![FreeVar], !*ExpressionState, !*ExpressionInfo, !*CheckState)
check_generic_expr
free_vars entry=:{ste_kind=STE_Generic,ste_index} id kind
e_input=:{ei_mod_index} e_state e_info cs
e_input=:{ei_mod_index} e_state
e_info=:{ef_generic_defs} cs
//#! e_info = {e_info & ef_generic_defs = add_kind ef_generic_defs ste_index kind}
= check_it free_vars ei_mod_index ste_index id kind e_input e_state e_info cs
check_generic_expr
free_vars entry=:{ste_kind=STE_Imported STE_Generic mod_index, ste_index} id kind
e_input e_state e_info cs
e_input e_state
e_info=:{ef_modules} cs
//#! (dcl_module, ef_modules) = ef_modules ! [mod_index]
//#! (dcl_common, dcl_module) = dcl_module ! dcl_common
//#! (com_generic_defs, dcl_common) = dcl_common ! com_generic_defs
//#! dcl_common = {dcl_common & com_generic_defs = add_kind com_generic_defs ste_index kind}
//#! dcl_module = {dcl_module & dcl_common = dcl_common}
//#! ef_modules = {ef_modules & [mod_index] = dcl_module}
//#! e_info = { e_info & ef_modules = ef_modules }
= check_it free_vars mod_index ste_index id kind e_input e_state e_info cs
check_generic_expr free_vars entry=:{ste_kind=STE_Empty} id kind e_input e_state e_info cs=:{cs_error}
= (EE, free_vars, e_state, e_info, { cs & cs_error = checkError id "undefined generic" cs_error })
......@@ -889,7 +901,12 @@ checkExpression free_vars (PE_Generic id=:{id_name,id_info} kind) e_input e_stat
#! e_state = { e_state & es_expr_heap = es_expr_heap }
#! cs = { cs & cs_x.x_needed_modules = cs_x.x_needed_modules bitor cNeedStdGeneric }
= (App app, free_vars, e_state, e_info, cs)
add_kind :: !*{#GenericDef} !Index !TypeKind -> !*{#GenericDef}
add_kind generic_defs generic_index kind
# (generic_def, generic_defs) = generic_defs ! [generic_index]
= {generic_defs & [generic_index] = addGenericKind generic_def kind}
// ..AA
checkExpression free_vars expr e_input e_state e_info cs
= abort "checkExpression (checkFunctionBodies.icl, line 868)" // <<- expr
......
This diff is collapsed.
......@@ -270,17 +270,27 @@ cNameLocationDependent :== True
}
// AA ...
:: GenericDef =
{ gen_name :: !Ident // the generics name in the IC_Class
, gen_member_name :: !Ident // the generics name in the IC_Member
{ gen_name :: !Ident // the generics name in the IC_Class
, gen_member_name :: !Ident // the generics name in the IC_Member
, gen_args :: ![TypeVar]
, gen_arity :: !Int // number of gen_args
, gen_arity :: !Int // number of gen_args
, gen_type :: !SymbolType
, gen_pos :: !Position
, gen_classes :: ![DefinedSymbol] // generated classes
, gen_isomap :: !DefinedSymbol // isomap function
, gen_classes :: !GenericClassInfos // generated classes
, gen_isomap :: !DefinedSymbol // isomap function
}
:: GenericClassInfo =
{ gci_kind :: !TypeKind
, gci_class :: !DefinedSymbol
}
:: GenericClassInfos :== [GenericClassInfo]
getGenericClassForKind :: !GenericDef !TypeKind -> (!Bool, DefinedSymbol)
addGenericKind :: !GenericDef !TypeKind -> !GenericDef
// ... AA
:: InstanceType =
......
......@@ -260,10 +260,37 @@ cNameLocationDependent :== True
, gen_arity :: !Int // number of gen_args
, gen_type :: !SymbolType
, gen_pos :: !Position
, gen_classes :: ![DefinedSymbol] // generated classes
, gen_isomap :: !DefinedSymbol // isomap function
, gen_classes :: !GenericClassInfos // generated classes
, gen_isomap :: !DefinedSymbol // isomap function
}
:: GenericClassInfo =
{ gci_kind :: !TypeKind
, gci_class :: !DefinedSymbol
}
:: GenericClassInfos :== [GenericClassInfo]
getGenericClassForKind :: !GenericDef !TypeKind -> (!Bool, DefinedSymbol)
getGenericClassForKind {gen_classes} kind
= get_class gen_classes kind
where
get_class [] kind
= (False, undef)
get_class [{gci_kind, gci_class}:gcis] kind
| gci_kind == kind = (True, gci_class)
| otherwise = get_class gcis kind
addGenericKind :: !GenericDef !TypeKind -> !GenericDef
addGenericKind generic_def=:{gen_name, gen_classes} kind
#(ok, _) = getGenericClassForKind generic_def kind
| ok = generic_def
# class_ds =
{ ds_ident = {id_name = gen_name.id_name +++ ":" +++ toString kind, id_info = nilPtr}
, ds_index = NoIndex
, ds_arity = 1
}
= {generic_def & gen_classes = [{gci_kind = kind, gci_class = class_ds}:gen_classes]}
// ..AA
:: InstanceType =
......
Supports Markdown
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