Commit 8d805777 authored by John van Groningen's avatar John van Groningen
Browse files

do not allow a . before (c a) in the type of a constructor,

because all attributes of c should have the same attribute
parent ca5f6ba5
......@@ -69,6 +69,8 @@ where
check_attr_of_type_var TA_Unique (TV var) error
// the case "TA_Var" is catched by check_type_attribute
= checkError var "uniqueness attribute not allowed" error
check_attr_of_type_var TA_Anonymous (CV tv :@: types) error
= checkError tv "attribute variable not allowed" error
check_attr_of_type_var attr _ error
= error
......@@ -704,12 +706,10 @@ checkOpenAType mod_index scope dem_attr type=:{at_type = arg_type --> result_typ
(result_type, (ots, oti, cs)) = checkOpenAType mod_index scope DAK_None result_type cot_state
(new_attr, oti, cs) = newAttribute dem_attr "-->" at_attribute oti cs
= ({ type & at_type = arg_type --> result_type, at_attribute = new_attr }, (ots, oti, cs))
//AA..
checkOpenAType mod_index scope dem_attr type=:{at_type = TArrow1 arg_type, at_attribute} cot_state
# (arg_type, (ots, oti, cs)) = checkOpenAType mod_index scope DAK_None arg_type cot_state
(new_attr, oti, cs) = newAttribute dem_attr "TArrow1" at_attribute oti cs
= ({ type & at_type = TArrow1 arg_type, at_attribute = new_attr }, (ots, oti, cs))
//..AA
/*
checkOpenAType mod_index scope dem_attr type=:{at_type = CV tv :@: types, at_attribute} (ots, oti, cs)
# (cons_var, _, (oti, cs)) = checkTypeVar scope DAK_None tv TA_Multi (oti, cs)
......
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