fastparse

Describe recursive grammar with type aliases

*爱你&永不变心* 提交于 2019-12-24 02:37:07
问题 How can I describe this recursive grammar with type aliases: type FieldValue = Seq[String] :+: String :+: Int :+: Long :+: CNil type FieldLeaf = FieldValue :+: SubField :+: CNil type SubField = Seq[Field] type Field = (String, FieldLeaf) As it stands, the Scala compiler (2.12.1) gives me: Error:(14, 25) illegal cyclic reference involving type FieldLeaf type Field = (String, FieldLeaf) PS the context of this is parsing a recursive grammar with fastparse. Edit (in response to