Commit da050a44 authored by John van Groningen's avatar John van Groningen
Browse files

report error for deriving a generic instance of an extensible algebraic type

parent 6424da60
......@@ -264,11 +264,17 @@ where
build_generic_type_rep td_rhs type_def_ident glob_module glob_object td_info g_ident_name gc_pos funs_and_groups gs
= case td_rhs of
SynType _
# gs_error = reportError g_ident_name gc_pos ("cannot derive a generic instance for a synonym type " +++ type_def_ident.id_name) gs.gs_error
-> (funs_and_groups, {gs & gs_error = gs_error})
# gs_error = report_derive_error g_ident_name gc_pos "a synonym type " type_def_ident.id_name gs.gs_error
-> (funs_and_groups, {gs & gs_error = gs_error})
AbstractType _
# gs_error = reportError g_ident_name gc_pos ("cannot derive a generic instance for an abstract type " +++ type_def_ident.id_name) gs.gs_error
-> (funs_and_groups, {gs & gs_error = gs_error})
# gs_error = report_derive_error g_ident_name gc_pos "an abstract type " type_def_ident.id_name gs.gs_error
-> (funs_and_groups, {gs & gs_error = gs_error})
ExtensibleAlgType _
# gs_error = report_derive_error g_ident_name gc_pos "an extensible algebraic type " type_def_ident.id_name gs.gs_error
-> (funs_and_groups, {gs & gs_error = gs_error})
AlgConses _ _
# gs_error = report_derive_error g_ident_name gc_pos "an extensible algebraic type " type_def_ident.id_name gs.gs_error
-> (funs_and_groups, {gs & gs_error = gs_error})
_
-> case td_info.tdi_gen_rep of
Yes _
......@@ -281,6 +287,9 @@ where
# gs = {gs & gs_td_infos.[glob_module,glob_object] = td_info}
-> (funs_and_groups, gs)
report_derive_error g_ident_name gc_pos kind_of_type_string type_def_ident_name gs_error
= reportError g_ident_name gc_pos ("cannot derive a generic instance for "+++kind_of_type_string+++type_def_ident_name) gs_error
:: TypeInfos
= AlgebraicInfo !DefinedSymbol !DefinedSymbol ![DefinedSymbol] ![DefinedSymbol]
| RecordInfo !DefinedSymbol !DefinedSymbol !DefinedSymbol ![DefinedSymbol]
......
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