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);
1665Debug.Assert(call.Method.Name == "Add");
2694diagnostics.Add(ErrorCode.ERR_QueryNoProvider, node.Location, receiverOpt.Type, memberSymbol.Name);
2710else if (node.Kind() == SyntaxKind.AwaitExpression && memberSymbol.Name == WellKnownMemberNames.GetAwaiter)
Binder\Binder_Expressions.cs (17)
2049localSymbol.Name,
2146Error(diagnostics, ErrorCode.ERR_AnonDelegateCantUse, node, parameter.Name);
2155Error(diagnostics, ErrorCode.ERR_AnonDelegateCantUseRefLike, node, parameter.Name);
2169Error(diagnostics, ErrorCode.ERR_UnsupportedPrimaryConstructorParameterCapturingRef, node, parameter.Name);
2178Error(diagnostics, ErrorCode.ERR_UnsupportedPrimaryConstructorParameterCapturingRefLike, node, parameter.Name);
3803parameter.Name,
3804correspondingParameter.Name);
3822parameter.Name,
3823correspondingParameter.Name);
6188if (!requiredMembersBuilder.TryGetValue(memberSymbol.Name, out var requiredMember))
6198requiredMembersBuilder.Remove(memberSymbol.Name);
7524if (leftType.Name == leftName || IsUsingAliasInScope(leftName))
7559return (type.Name == name || IsUsingAliasInScope(name)) &&
10185var name = candidate.IsIndexer ? SyntaxFacts.GetText(SyntaxKind.ThisKeyword) : candidate.Name;
10497syntax, typeArgumentsOpt: default, method.Name, ImmutableArray.Create(method),
10501indexerOrSliceAccess = BindMethodGroupInvocation(syntax, syntax, method.Name, boundMethodGroup, analyzedArguments,
10599return 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);
5011if ((leftType.IsNotNull && methodOpt.ReturnNotNullIfParameterNotNull.Contains(methodOpt.Parameters[0].Name)) ||
5012(rightType.IsNotNull && methodOpt.ReturnNotNullIfParameterNotNull.Contains(methodOpt.Parameters[1].Name)))
6581|| (method.Name != SpecialMembers.GetDescriptor(SpecialMember.System_Object__Equals).Name
6582&& method.Name != SpecialMembers.GetDescriptor(SpecialMember.System_Object__ReferenceEquals).Name
7201if (returnNotNullIfParameterNotNull?.Contains(parameter.Name) == true)
9764var returnNotNull = operandState.IsNotNull() && method.ReturnNotNullIfParameterNotNull.Contains(parameter.Name);
13057var 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);
2076diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, symbol.GetFirstLocation(), containerForDiagnostics, symbol.Name);
2219(method1.IsConstructor() ? method1.ContainingType.Name : method1.Name);
2265typeParameterNames.Add(typeParameter.Name);
2543foreach (var dup in GetMembers(tp.Name))
2545diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, dup.GetFirstLocation(), this, tp.Name);
3571(member.IsIndexer() ? WellKnownMemberNames.Indexer : member.Name).AsMemory(),
3783if (member.Name == name)
4358accessorName = accessor.Name;
4362string propertyName = propertySymbol.IsIndexer ? propertySymbol.MetadataName : propertySymbol.Name;
4405string accessorName = SourceEventSymbol.GetAccessorName(eventSymbol.Name, isAdder);
4769memberNames.Add(member.Name);
4776case FieldSymbol { Name: var fieldName }:
5110var targetProperty = new SignatureOnlyPropertySymbol(param.Name,
5119&& !fieldsByName.TryGetValue(param.Name, out existingMember))
5161param.Name);
5185if (memberNames.Contains(symbol.Name) || this.GetTypeMembersDictionary().ContainsKey(symbol.Name.AsMemory()))
Symbols\Source\SourceOrdinaryMethodSymbol.cs (7)
586return !definition.Parameters.SequenceEqual(implementation.Parameters, (a, b) => a.Name == b.Name) ||
587!definition.TypeParameters.SequenceEqual(implementation.TypeParameters, (a, b) => a.Name == b.Name);
617diagnostics.Add(ErrorCode.ERR_PartialMethodInconsistentConstraints, implementation.GetFirstLocation(), implementation, typeParameter2.Name);
621diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInConstraintsOnPartialImplementation, implementation.GetFirstLocation(), implementation, typeParameter2.Name);
923else if (ContainingType is { IsExtension: true, ExtensionParameter.Name: "" } && !IsStatic)
Symbols\TypeSymbol.cs (7)
1616correspondingImplementingAccessor.Name,
1740foreach (Symbol member in implicitImpl.ContainingType.GetMembers(implicitImpl.Name))
2138diagnostics.Add(ErrorCode.ERR_ImplBadConstraints, GetImplicitImplementationDiagnosticLocation(interfaceMethod, implementingType, implicitImpl), typeParameter2.Name, implicitImpl, typeParameter1.Name, interfaceMethod);
2143typeParameter2.Name, implicitImpl, typeParameter1.Name, interfaceMethod);
2197foreach (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))