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); }
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); }