Binder\Binder_Attributes.cs (5)
405Error(diagnostics, ErrorCode.ERR_BadAttributeParamType, syntax, parameter.Name, paramType.Type);
664namedArgumentNameSymbol.Name));
677namedArgumentNameSymbol.Name));
816visitedArgument = new KeyValuePair<String, TypedConstant>(fa.FieldSymbol.Name, VisitExpression(assignment.Right, diagnostics, ref attrHasErrors, assignment.HasAnyErrors));
821visitedArgument = new KeyValuePair<String, TypedConstant>(pa.PropertySymbol.Name, VisitExpression(assignment.Right, diagnostics, ref attrHasErrors, assignment.HasAnyErrors));
Binder\Binder_Conversions.cs (5)
430if (SyntaxFacts.IsCheckedOperator(method.Name) &&
783return binder.BindClassCreationExpression(syntax, type.Name, typeNode: syntax, (NamedTypeSymbol)type, arguments, diagnostics, initializerOpt, wasTargetTyped: true);
1670Debug.Assert(call.Method.Name == "Add");
2699diagnostics.Add(ErrorCode.ERR_QueryNoProvider, node.Location, receiverOpt.Type, memberSymbol.Name);
2715else if (node.Kind() == SyntaxKind.AwaitExpression && memberSymbol.Name == WellKnownMemberNames.GetAwaiter)
Binder\Binder_Expressions.cs (17)
2051localSymbol.Name,
2148Error(diagnostics, ErrorCode.ERR_AnonDelegateCantUse, node, parameter.Name);
2157Error(diagnostics, ErrorCode.ERR_AnonDelegateCantUseRefLike, node, parameter.Name);
2171Error(diagnostics, ErrorCode.ERR_UnsupportedPrimaryConstructorParameterCapturingRef, node, parameter.Name);
2180Error(diagnostics, ErrorCode.ERR_UnsupportedPrimaryConstructorParameterCapturingRefLike, node, parameter.Name);
3805parameter.Name,
3806correspondingParameter.Name);
3824parameter.Name,
3825correspondingParameter.Name);
6190if (!requiredMembersBuilder.TryGetValue(memberSymbol.Name, out var requiredMember))
6200requiredMembersBuilder.Remove(memberSymbol.Name);
7526if (leftType.Name == leftName || IsUsingAliasInScope(leftName))
7561return (type.Name == name || IsUsingAliasInScope(name)) &&
10195var name = candidate.IsIndexer ? SyntaxFacts.GetText(SyntaxKind.ThisKeyword) : candidate.Name;
10507syntax, typeArgumentsOpt: default, method.Name, ImmutableArray.Create(method),
10511indexerOrSliceAccess = BindMethodGroupInvocation(syntax, syntax, method.Name, boundMethodGroup, analyzedArguments,
10609return new ErrorPropertySymbol(candidate.ContainingType, propertyType, candidate.Name, candidate.IsIndexer, candidate.IsIndexedProperty);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (7)
521Debug.Assert(firstSupported.Member is MethodSymbol { Name: "Add" });
662diagnostics.Add(ErrorCode.ERR_QueryNoProvider, location, receiverOpt.Type, symbol.Name);
668else if (nodeOpt?.Kind() == SyntaxKind.AwaitExpression && symbol.Name == WellKnownMemberNames.GetAwaiter)
751Binder.ReportQueryInferenceFailed(queryClause, inferenceFailed.Member.Name, receiver, arguments, symbols, diagnostics);
773binder.ReportQueryLookupFailed(queryClause, instanceArgument, inferenceFailed.Member.Name, symbols, diagnostics);
779new object[] { instanceArgument.Type, inferenceFailed.Member.Name },
909badParamName = parameters[badParamIndex].Name;
FlowAnalysis\DefiniteAssignment.cs (13)
523Diagnostics.Add(ErrorCode.ERR_ParamUnassigned, location, parameter.Name);
542Diagnostics.Add(ErrorCode.ERR_ParamUnassigned, location, parameter.Name);
694diagnostics.Add(ErrorCode.ERR_LocalCantBeFixedAndHoisted, location, captured.Name);
1228string symbolName = symbol.Name;
1311var symbolName = hasAssociatedProperty ? associatedSymbol.Name : fieldSymbol.Name;
1966parameter.GetFirstLocationOrNone(), parameter.Name);
2338if (symbol.DeclarationKind != LocalDeclarationKind.PatternVariable && !string.IsNullOrEmpty(symbol.Name)) // avoid diagnostics for parser-inserted names
2340Diagnostics.Add(assigned && _writtenVariables.Contains(symbol) ? ErrorCode.WRN_UnreferencedVarAssg : ErrorCode.WRN_UnreferencedVar, symbol.GetFirstLocationOrNone(), symbol.Name);
2357if (!string.IsNullOrEmpty(symbol.Name)) // avoid diagnostics for parser-inserted names
2359Diagnostics.Add(ErrorCode.WRN_UnreferencedLocalFunction, symbol.GetFirstLocationOrNone(), symbol.Name);
2861string.IsNullOrEmpty(id.Symbol.Name) ? "<anon>" + id.Symbol.GetHashCode() :
2862id.Symbol.Name);
FlowAnalysis\NullableWalker.cs (17)
770if ((symbol.IsRequired() || membersWithStateEnforcedByRequiredMembers.Contains(symbol.Name)) && constructor.ShouldCheckRequiredMembers())
803var info = new CSDiagnosticInfo(errorCode, new object[] { symbol.Kind.Localize(), symbol.Name }, ImmutableArray<Symbol>.Empty, additionalLocations: symbol.Locations);
1068Diagnostics.Add(ErrorCode.WRN_MemberNotNull, syntax.GetLocation(), member.Name);
1137Diagnostics.Add(ErrorCode.WRN_MemberNotNullWhen, syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation(), member.Name, sense ? "true" : "false");
1309Diagnostics.Add(ErrorCode.WRN_ParameterDisallowsNull, location, parameter.Name);
1336Diagnostics.Add(ErrorCode.WRN_ParameterConditionallyDisallowsNull, syntax.Location, parameter.Name, sense ? "true" : "false");
1387if (inputParamNames.Contains(inputParam.Name)
1395Diagnostics.Add(ErrorCode.WRN_ParameterNotNullIfNotNull, location, outputParam.Name, inputParam.Name);
1400Diagnostics.Add(ErrorCode.WRN_ReturnNotNullIfNotNull, location, inputParam.Name);
5065if ((leftType.IsNotNull && methodOpt.ReturnNotNullIfParameterNotNull.Contains(methodOpt.Parameters[0].Name)) ||
5066(rightType.IsNotNull && methodOpt.ReturnNotNullIfParameterNotNull.Contains(methodOpt.Parameters[1].Name)))
6730|| (method.Name != SpecialMembers.GetDescriptor(SpecialMember.System_Object__Equals).Name
6731&& method.Name != SpecialMembers.GetDescriptor(SpecialMember.System_Object__ReferenceEquals).Name
7350if (returnNotNullIfParameterNotNull?.Contains(parameter.Name) == true)
9913var returnNotNull = operandState.IsNotNull() && method.ReturnNotNullIfParameterNotNull.Contains(parameter.Name);
13415var name = id.Symbol.Name;
Lowering\SynthesizedMethodBaseSymbol.cs (1)
127p.Name,
Symbols\Source\SourceMemberContainerSymbol.cs (21)
1278return (IsTupleType || IsRecord || IsRecordStruct || this.declaration.ContainsExtensionDeclarations) ? GetMembers().Select(m => m.Name) : this.declaration.MemberNames;
1394if (member.Name == this.Name)
1620{ symbol.Name.AsMemory(), ImmutableArray.Create(symbol) },
1637ImmutableArrayExtensions.AddToMultiValueDictionaryBuilder(accumulator, item.Name.AsMemory(), item);
2075diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, symbol.GetFirstLocation(), containerForDiagnostics, symbol.Name);
2218(method1.IsConstructor() ? method1.ContainingType.Name : method1.Name);
2264typeParameterNames.Add(typeParameter.Name);
2562foreach (var dup in GetMembers(tp.Name))
2564diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, dup.GetFirstLocation(), this, tp.Name);
3601(member.IsIndexer() ? WellKnownMemberNames.Indexer : member.Name).AsMemory(),
3813if (member.Name == name)
4388accessorName = accessor.Name;
4392string propertyName = propertySymbol.IsIndexer ? propertySymbol.MetadataName : propertySymbol.Name;
4435string accessorName = SourceEventSymbol.GetAccessorName(eventSymbol.Name, isAdder);
4802memberNames.Add(member.Name);
4809case FieldSymbol { Name: var fieldName }:
5143var targetProperty = new SignatureOnlyPropertySymbol(param.Name,
5152&& !fieldsByName.TryGetValue(param.Name, out existingMember))
5194param.Name);
5218if (memberNames.Contains(symbol.Name) || this.GetTypeMembersDictionary().ContainsKey(symbol.Name.AsMemory()))
Symbols\Source\SourceOrdinaryMethodSymbol.cs (7)
251else if (ContainingType is { IsExtension: true, ExtensionParameter.Name: "" } && !IsStatic)
590return !definition.Parameters.SequenceEqual(implementation.Parameters, (a, b) => a.Name == b.Name) ||
591!definition.TypeParameters.SequenceEqual(implementation.TypeParameters, (a, b) => a.Name == b.Name);
621diagnostics.Add(ErrorCode.ERR_PartialMethodInconsistentConstraints, implementation.GetFirstLocation(), implementation, typeParameter2.Name);
625diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInConstraintsOnPartialImplementation, implementation.GetFirstLocation(), implementation, typeParameter2.Name);
Symbols\TypeSymbol.cs (7)
1618correspondingImplementingAccessor.Name,
1742foreach (Symbol member in implicitImpl.ContainingType.GetMembers(implicitImpl.Name))
2140diagnostics.Add(ErrorCode.ERR_ImplBadConstraints, GetImplicitImplementationDiagnosticLocation(interfaceMethod, implementingType, implicitImpl), typeParameter2.Name, implicitImpl, typeParameter1.Name, interfaceMethod);
2145typeParameter2.Name, implicitImpl, typeParameter1.Name, interfaceMethod);
2199foreach (Symbol member in currType.GetMembers(interfaceMember.Name))
Symbols\TypeSymbolExtensions.cs (16)
561if ((object)symbol == null || symbol.Name != names[i]) return false;
1376ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true },
1389ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true },
1397ContainingNamespace: { Name: "System", ContainingNamespace: { IsGlobalNamespace: true } },
1408ContainingNamespace: { Name: "System", ContainingNamespace: { IsGlobalNamespace: true } },
1419ContainingNamespace: { Name: "System", ContainingNamespace: { IsGlobalNamespace: true } },
1724if (name == tpEnclosing.Name)
1759if (typeParameter.Name == name)
1825var name = @namespace.Name;
2154if (typeSymbol.Name != name || typeSymbol.ContainingType is object)
2164if (typeSymbol.Name != name)
2176=> type.Name == "SetsRequiredMembersAttribute" && type.IsWellKnownDiagnosticsCodeAnalysisTopLevelType();
2195if (innerNamespace?.Name != innerNS)
2206if (midNamespace?.Name != midNS)
2212if (outerNamespace?.Name != outerNS)
2279switch (GeneratedNameParser.GetKind(type.Name))