Closed ptal closed 8 years ago
It is the desired behavior... This is related to the fact that we can not build recursive type by ourself. We must re-introduce the recursive type analysis in the typing module.
Actually, this is not true for all grammars, let consider this grammar:
r = "a" r
/ "b"
It actually leads to a bug because r
is not well-typed, it has the type Tuple(vec[rule_id])
where rule_id
is the type of r
. We would like to allow this kind of rules and infer the type unit.
Therefore, we propose to infer unit type for recursive types by default and provide a warning informing that the unit type has been affected by default to r
because it has a recursive type definition.
If recursive rules are calling each other we do not infer a unit type.