public static void ReportAmbiguousUnaryOperator(this ICollection<Diagnostic> diagnostics, SyntaxToken operatorToken, TypeSymbol type)
 {
     var operatorName = operatorToken.Text;
     var typeName = type.ToDisplayName();
     diagnostics.Report(operatorToken.Span, DiagnosticId.AmbiguousUnaryOperator, operatorName, typeName);
 }
 public static void ReportAmbiguousBinaryOperator(this ICollection<Diagnostic> diagnostics, SyntaxToken operatorToken, TypeSymbol leftType, TypeSymbol rightType)
 {
     var operatorName = operatorToken.Text;
     var leftTypeName = leftType.ToDisplayName();
     var rightTypeName = rightType.ToDisplayName();
     diagnostics.Report(operatorToken.Span, DiagnosticId.AmbiguousBinaryOperator, operatorName, leftTypeName, rightTypeName);
 }
 public static void ReportCannotConvert(this ICollection<Diagnostic> diagnostics, TextSpan span, TypeSymbol sourceType, TypeSymbol targetType)
 {
     var sourceTypeName = sourceType.ToDisplayName();
     var targetTypeName = targetType.ToDisplayName();
     diagnostics.Report(span, DiagnosticId.CannotConvert, sourceTypeName, targetTypeName);
 }
 public static void ReportUndeclaredField(this ICollection<Diagnostic> diagnostics, FieldAccessExpressionSyntax node, TypeSymbol type)
 {
     var typeName = type.ToDisplayName();
     var propertyName = node.Name.ValueText;
     diagnostics.Report(node.GetTextSpanSafe(), DiagnosticId.UndeclaredField, typeName, propertyName);
 }
 public static void ReportUndeclaredIndexer(this ICollection<Diagnostic> diagnostics, ElementAccessExpressionSyntax node, TypeSymbol declaringType, IEnumerable<TypeSymbol> argumentTypes)
 {
     var declaringTypeName = declaringType.ToDisplayName();
     var argumentTypeNames = string.Join(@", ", argumentTypes.Select(t => t.ToDisplayName()));
     diagnostics.Report(node.GetTextSpanRoot(), DiagnosticId.UndeclaredIndexer, declaringTypeName, argumentTypeNames);
 }
 public static void ReportUndeclaredMethod(this ICollection<Diagnostic> diagnostics, MethodInvocationExpressionSyntax node, TypeSymbol declaringType, IEnumerable<TypeSymbol> argumentTypes)
 {
     var name = node.Name.ValueText;
     var declaringTypeName = declaringType.ToDisplayName();
     var argumentTypeNames = string.Join(@", ", argumentTypes.Select(t => t.ToDisplayName()));
     diagnostics.Report(node.GetTextSpanRoot(), DiagnosticId.UndeclaredMethod, declaringTypeName, name, argumentTypeNames);
 }