예제 #1
0
        public void AddTypeParameterContraint(string name, SwiftType constraint)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            if (constraint == null)
            {
                throw new ArgumentNullException("constraint");
            }

            if (!_parameters.ContainsKey(name))
            {
                throw new ArgumentOutOfRangeException("name", name, "Unknown type parameter name.");
            }

            _parameterContraints.Add(name, constraint);
        }
예제 #2
0
        public void AddTypeParameter(string name, SwiftType parameter)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            if (parameter == null)
            {
                throw new ArgumentNullException("parameter");
            }

            if (_parameters.ContainsKey(name))
            {
                throw new ArgumentOutOfRangeException("name", name, "Duplicate type parameter name.");
            }

            _parameters.Add(name, parameter);
            _parameterNames.Add(name);
        }