Commit 337092e2 authored by Mart Lubbers's avatar Mart Lubbers

Fix gEditor for newtypes

parent e3abfac7
Pipeline #12916 passed with stage
in 3 minutes and 10 seconds
......@@ -135,7 +135,11 @@ where
* - There is only one constructor
* - There are multiple constructors
*/
gEditor{|OBJECT of {gtd_num_conses,gtd_conses}|} {genUI=exGenUI,onEdit=exOnEdit,onRefresh=exOnRefresh} _ _ _ _
gEditor{|OBJECT of {gtd_num_conses,gtd_conses}|} ce=:{genUI=exGenUI,onEdit=exOnEdit,onRefresh=exOnRefresh} _ _ _ _
//This is a newtype
| gtd_num_conses == 0
= bijectEditorValue (\(OBJECT i)->i) (\i->OBJECT i) ce
//This is not a newtype
= withEditModeAttr {Editor|genUI=genUI,onEdit=onEdit,onRefresh=onRefresh}
where
gcd_names = [gcd_name \\ {GenericConsDescriptor | gcd_name} <- gtd_conses] // preselect cons names to circumvent cyclic dependencies
......
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