public virtual TResult VisitArray(BoundArrayEx x) => DefaultVisitOperation(x);
 public virtual void VisitArray(BoundArrayEx x)
 {
     x.Items.ForEach(pair =>
     {
         Accept(pair.Key);
         Accept(pair.Value);
     });
 }
Exemple #3
0
 public BoundArrayInitializer(BoundArrayEx array)
 {
     _array = array;
 }
        public override void VisitArray(BoundArrayEx x)
        {
            var items = x.Items;
            TypeRefMask elementType = 0;

            // analyse elements
            foreach (var i in items)
            {
                Accept(i.Key);
                Accept(i.Value);

                elementType |= i.Value.TypeRefMask;
            }

            // writeup result type
            x.TypeRefMask = elementType.IsVoid
                ? TypeCtx.GetArrayTypeMask()
                : TypeCtx.GetArrayTypeMask(elementType);
        }