PolymerLabs / arcs

Arcs
BSD 3-Clause "New" or "Revised" License
56 stars 35 forks source link

Generalize parsing of schema field types #7127

Open shans opened 3 years ago

shans commented 3 years ago

(from b/157522096)

A lot of types in the schema are needlessly strict - for example CollectionType only allows PrimitiveType or KotlinType as the inner type; UnionType only allows PrimitiveTypes to be unioned.

Part of this is probably to avoid awkwardness ([[Long]] isn't something we can handle yet) but we shouldn't be detecting this at the parsing stage. Unless there's a really good reason for it, we should recurse back to the top level SchemaType production where possible.