UNION is split into two primary forms:

1. Simple (No discriminator nor base)
2. Flat (Discriminator and base)

In expr.py, I notice that we modify the perceived type of the 'type' expression based on the two union forms.

1a. Simple unions allow Array[T]
1b. Flat unions disallow Array[T]

From the docs:

Syntax:
    UNION = { 'union': STRING,
              'data': BRANCHES,
              '*if': COND,
              '*features': FEATURES }
          | { 'union': STRING,
              'data': BRANCHES,
              'base': ( MEMBERS | STRING ),
              'discriminator': STRING,
              '*if': COND,
              '*features': FEATURES }
    BRANCHES = { BRANCH, ... }
    BRANCH = STRING : TYPE-REF
           | STRING : { 'type': TYPE-REF, '*if': COND }

Both arms use the same "BRANCHES" grammar production, which both use TYPE-REF.

    TYPE-REF = STRING | ARRAY-TYPE
    ARRAY-TYPE = [ STRING ]

Implying that List[T] should be allowed for both productions.
Can I ask for a ruling from the judges?

--js


Reply via email to