/// <summary> /// Determines whether every constraint type on this type parameter /// names a concept. /// <remarks> /// This is a requirement for witness type parameters, mainly to /// ensure that their syntax isn't accidentally or intentionally /// misused. /// </remarks> /// </summary> /// <param name="diagnostics"> /// The diagnostics bag to which errors raised by non-concept-naming /// constraint types will be added. /// </param> private void CheckAllConstraintTypesNameConcepts(DiagnosticBag diagnostics) { foreach (var constraintType in ConstraintTypesNoUseSiteDiagnostics) { if (!constraintType.IsConceptType()) { var loc = constraintType.Locations.IsEmpty ? Location.None : constraintType.Locations[0]; // Currently, call this a missing type variable in the constraint. // This may change later. diagnostics.Add(ErrorCode.ERR_TyVarNotFoundInConstraint, ClauseLocation, Name, ContainingSymbol.ConstructedFrom()); } } }