SwiftType GetPropertyType(SwiftPropertyType getter, SwiftPropertyType setter)
 {
     if (getter != null)
     {
         return(getter.ReturnType);
     }
     if (setter != null)
     {
         if (setter.IsSubscript)
         {
             return(((SwiftTupleType)setter.Parameters).Contents [0]);
         }
         else
         {
             return(setter.Parameters);
         }
     }
     throw ErrorHelper.CreateError(ReflectorError.kCompilerBase + 0, "neither getter nor setter provided");
 }
        public SwiftPropertyType RecastAsStatic()
        {
            if (IsStatic)
            {
                return(this);
            }
            SwiftPropertyType newProp = null;

            if (OfType is SwiftFunctionType)
            {
                newProp = new SwiftPropertyType(UncurriedParameter, PropertyType, Name, PrivateName, OfType as SwiftFunctionType,
                                                true, IsReference);
            }
            else
            {
                newProp = new SwiftPropertyType(UncurriedParameter, PropertyType, Name, PrivateName, OfType, true, IsReference);
            }
            newProp.DiscretionaryString = DiscretionaryString;
            newProp.ExtensionOn         = this.ExtensionOn;
            return(newProp);
        }