Пример #1
0
        public ITypeState GetLastCommonAncestorOrNull(ITypeState otherType)
        {
            var arrayType = otherType as StateArray;

            if (arrayType == null)
            {
                return(StatePrimitive.Any);
            }
            var elementTypeA = Element as ITypeState;

            if (elementTypeA == null)
            {
                return(null);
            }
            var elementTypeB = arrayType.Element as ITypeState;

            if (elementTypeB == null)
            {
                return(null);
            }
            var ancestor = elementTypeA.GetLastCommonAncestorOrNull(elementTypeB);

            if (ancestor == null)
            {
                return(null);
            }
            return(StateArray.Of(ancestor));
        }
Пример #2
0
 public ICompositeState GetNonReferenced()
 => StateArray.Of(ElementNode.GetNonReference());