Binder\Binder_Attributes.cs (5)
407Error(diagnostics, ErrorCode.ERR_BadAttributeParamType, syntax, parameter.Name, paramType.Type);
672namedArgumentNameSymbol.Name));
685namedArgumentNameSymbol.Name));
824visitedArgument = new KeyValuePair<String, TypedConstant>(fa.FieldSymbol.Name, VisitExpression(assignment.Right, diagnostics, ref attrHasErrors, assignment.HasAnyErrors));
829visitedArgument = new KeyValuePair<String, TypedConstant>(pa.PropertySymbol.Name, VisitExpression(assignment.Right, diagnostics, ref attrHasErrors, assignment.HasAnyErrors));
Binder\Binder_Conversions.cs (8)
495if (SyntaxFacts.IsCheckedOperator(method.Name) &&
862return binder.BindClassCreationExpression(syntax, type.Name, typeNode: syntax, (NamedTypeSymbol)type, arguments, diagnostics, initializerOpt, wasTargetTyped: true);
1387var methodName = collectionBuilderMethods[0].Name;
1388Debug.Assert(collectionBuilderMethods.All(t => t.Name == methodName));
1445argumentNames = argumentNames.Add(readonlySpanParameter.Name);
2251Debug.Assert(call.Method.Name == "Add");
3398diagnostics.Add(ErrorCode.ERR_QueryNoProvider, node.Location, receiverOpt.Type, memberSymbol.Name);
3414else if (node.Kind() == SyntaxKind.AwaitExpression && memberSymbol.Name == WellKnownMemberNames.GetAwaiter)
Binder\Binder_Expressions.cs (19)
1839primaryConstructor.Parameters.Any(static (p, name) => p.Name == name, name) &&
2102Error(diagnostics, ErrorCode.ERR_ExtensionParameterInStaticContext, node, parameter.Name);
2124Error(diagnostics, ErrorCode.ERR_AnonDelegateCantUse, node, parameter.Name);
2133Error(diagnostics, ErrorCode.ERR_AnonDelegateCantUseRefLike, node, parameter.Name);
2147Error(diagnostics, ErrorCode.ERR_UnsupportedPrimaryConstructorParameterCapturingRef, node, parameter.Name);
2156Error(diagnostics, ErrorCode.ERR_UnsupportedPrimaryConstructorParameterCapturingRefLike, node, parameter.Name);
2281localSymbol.Name,
3890parameter.Name,
3891correspondingParameter.Name);
3909parameter.Name,
3910correspondingParameter.Name);
6337if (!requiredMembersBuilder.TryGetValue(memberSymbol.Name, out var requiredMember))
6347requiredMembersBuilder.Remove(memberSymbol.Name);
7745if (leftType.Name == leftName || IsUsingAliasInScope(leftName))
7777return (type.Name == name || IsUsingAliasInScope(name)) &&
10459var name = candidate.IsIndexer ? SyntaxFacts.GetText(SyntaxKind.ThisKeyword) : candidate.Name;
10772syntax, typeArgumentsOpt: default, method.Name, ImmutableArray.Create(method),
10776indexerOrSliceAccess = BindMethodGroupInvocation(syntax, syntax, method.Name, boundMethodGroup, analyzedArguments,
10875return new ErrorPropertySymbol(candidate.ContainingType, propertyType, candidate.Name, candidate.IsIndexer, candidate.IsIndexedProperty);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (7)
544Debug.Assert(firstSupported.Member is MethodSymbol { Name: "Add" });
685diagnostics.Add(ErrorCode.ERR_QueryNoProvider, location, receiverOpt.Type, symbol.Name);
691else if (nodeOpt?.Kind() == SyntaxKind.AwaitExpression && symbol.Name == WellKnownMemberNames.GetAwaiter)
774Binder.ReportQueryInferenceFailed(queryClause, inferenceFailed.Member.Name, receiver, arguments, symbols, diagnostics);
796binder.ReportQueryLookupFailed(queryClause, instanceArgument, inferenceFailed.Member.Name, symbols, diagnostics);
813new object[] { instanceArgument.Type, inferenceFailed.Member.Name },
944badParamName = parameters[badParamIndex].Name;
FlowAnalysis\DefiniteAssignment.cs (13)
474Diagnostics.Add(ErrorCode.ERR_ParamUnassigned, location, parameter.Name);
493Diagnostics.Add(ErrorCode.ERR_ParamUnassigned, location, parameter.Name);
645diagnostics.Add(ErrorCode.ERR_LocalCantBeFixedAndHoisted, location, captured.Name);
1180string symbolName = symbol.Name;
1263var symbolName = hasAssociatedProperty ? associatedSymbol.Name : fieldSymbol.Name;
1918parameter.GetFirstLocationOrNone(), parameter.Name);
2282if (symbol.DeclarationKind != LocalDeclarationKind.PatternVariable && !string.IsNullOrEmpty(symbol.Name)) // avoid diagnostics for parser-inserted names
2284Diagnostics.Add(assigned && _writtenVariables.Contains(symbol) ? ErrorCode.WRN_UnreferencedVarAssg : ErrorCode.WRN_UnreferencedVar, symbol.GetFirstLocationOrNone(), symbol.Name);
2301if (!string.IsNullOrEmpty(symbol.Name)) // avoid diagnostics for parser-inserted names
2303Diagnostics.Add(ErrorCode.WRN_UnreferencedLocalFunction, symbol.GetFirstLocationOrNone(), symbol.Name);
2809string.IsNullOrEmpty(id.Symbol.Name) ? "<anon>" + id.Symbol.GetHashCode() :
2810id.Symbol.Name);
FlowAnalysis\NullableWalker.cs (20)
811if ((symbol.IsRequired() || membersWithStateEnforcedByRequiredMembers.Contains(symbol.Name)) && constructor.ShouldCheckRequiredMembers())
845var info = new CSDiagnosticInfo(errorCode, new object[] { symbol.Kind.Localize(), symbol.Name }, ImmutableArray<Symbol>.Empty, additionalLocations: symbol.Locations);
1110Diagnostics.Add(ErrorCode.WRN_MemberNotNull, syntax.GetLocation(), member.Name);
1179Diagnostics.Add(ErrorCode.WRN_MemberNotNullWhen, syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation(), member.Name, sense ? "true" : "false");
1351Diagnostics.Add(ErrorCode.WRN_ParameterDisallowsNull, location, parameter.Name);
1378Diagnostics.Add(ErrorCode.WRN_ParameterConditionallyDisallowsNull, syntax.Location, parameter.Name, sense ? "true" : "false");
1429if (inputParamNames.Contains(inputParam.Name)
1437Diagnostics.Add(ErrorCode.WRN_ParameterNotNullIfNotNull, location, outputParam.Name, inputParam.Name);
1442Diagnostics.Add(ErrorCode.WRN_ReturnNotNullIfNotNull, location, inputParam.Name);
2067case PropertySymbol { Name: WellKnownMemberNames.ValuePropertyName } property when
5393if ((leftType.IsNotNull && methodOpt.ReturnNotNullIfParameterNotNull.Contains(methodOpt.Parameters[0].Name)) ||
5394(rightType.IsNotNull && methodOpt.ReturnNotNullIfParameterNotNull.Contains(methodOpt.Parameters[1].Name)))
7108|| (method.Name != SpecialMembers.GetDescriptor(SpecialMember.System_Object__Equals).Name
7109&& method.Name != SpecialMembers.GetDescriptor(SpecialMember.System_Object__ReferenceEquals).Name
7722if (returnNotNullIfParameterNotNull?.Contains(parameter.Name) == true)
8438if (notNullIfParameterNotNull.Contains(notNullParameter.Name))
10556var returnNotNull = operandState.IsNotNull() && method.ReturnNotNullIfParameterNotNull.Contains(method.Parameters[0].Name);
12257if (member is PropertySymbol { Name: WellKnownMemberNames.HasValuePropertyName } property &&
14284var name = id.Symbol.Name;
Lowering\SynthesizedMethodBaseSymbol.cs (1)
127p.Name,
Symbols\Source\SourceComplexParameterSymbol.cs (5)
711&& extensionParameter.Name.Equals(parameterName, StringComparison.Ordinal))
722if (parameters[i].Name.Equals(parameterName, StringComparison.Ordinal))
1400if (string.Equals(extensionParameter?.Name, name, StringComparison.Ordinal))
1412var parameter = containingSymbolParameters.FirstOrDefault(static (param, name) => string.Equals(param.Name, name, StringComparison.Ordinal), name);
1432diagnostics.Add(ErrorCode.WRN_ParameterOccursAfterInterpolatedStringHandlerParameter, arguments.AttributeSyntaxOpt.Location, parameter.Name, this.Name);
Symbols\Source\SourceMemberContainerSymbol.cs (22)
1386return (IsTupleType || IsRecord || IsRecordStruct || this.declaration.ContainsExtensionDeclarations) ? GetMembers().Select(m => m.Name) : this.declaration.MemberNames;
1528if (member.Name == typeName)
1536if (member.Name == typeName)
1755{ symbol.Name.AsMemory(), ImmutableArray.Create(symbol) },
1772ImmutableArrayExtensions.AddToMultiValueDictionaryBuilder(accumulator, item.Name.AsMemory(), item);
2236diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, symbol.GetFirstLocation(), containerForDiagnostics, symbol.Name);
2379(method1.IsConstructor() ? method1.ContainingType.Name : method1.Name);
2425typeParameterNames.Add(typeParameter.Name);
2674foreach (var dup in GetMembers(tp.Name))
2676diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, dup.GetFirstLocation(), this, tp.Name);
3719(member.IsIndexer() ? WellKnownMemberNames.Indexer : member.Name).AsMemory(),
3944if (member.Name == name)
4516accessorName = accessor.Name;
4520string propertyName = propertySymbol.IsIndexer ? propertySymbol.MetadataName : propertySymbol.Name;
4563string accessorName = SourceEventSymbol.GetAccessorName(eventSymbol.Name, isAdder);
5023memberNames.Add(member.Name);
5030case FieldSymbol { Name: var fieldName }:
5363var targetProperty = new SignatureOnlyPropertySymbol(param.Name,
5372&& !fieldsByName.TryGetValue(param.Name, out existingMember))
5414param.Name);
5438if (memberNames.Contains(symbol.Name) || this.GetTypeMembersDictionary().ContainsKey(symbol.Name.AsMemory()))
Symbols\Source\SourceOrdinaryMethodSymbol.cs (8)
253else if (ContainingType is { IsExtension: true, ExtensionParameter.Name: "" } && !IsStatic)
592return !definition.Parameters.SequenceEqual(implementation.Parameters, (a, b) => a.Name == b.Name) ||
593!definition.TypeParameters.SequenceEqual(implementation.TypeParameters, (a, b) => a.Name == b.Name);
624diagnostics.Add(ErrorCode.ERR_PartialMethodInconsistentConstraints, implementation.GetFirstLocation(), implementation, typeParameter2.Name);
628diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInConstraintsOnPartialImplementation, implementation.GetFirstLocation(), implementation, typeParameter2.Name);
1196if (name == result[i].Name)
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (1)
42param.Name,
Symbols\TypeSymbol.cs (7)
1610correspondingImplementingAccessor.Name,
1734foreach (Symbol member in implicitImpl.ContainingType.GetMembers(implicitImpl.Name))
2150diagnostics.Add(ErrorCode.ERR_ImplBadConstraints, GetImplicitImplementationDiagnosticLocation(interfaceMethod, implementingType, implicitImpl), typeParameter2.Name, implicitImpl, typeParameter1.Name, interfaceMethod);
2155typeParameter2.Name, implicitImpl, typeParameter1.Name, interfaceMethod);
2209foreach (Symbol member in currType.GetMembers(interfaceMember.Name))
Symbols\TypeSymbolExtensions.cs (16)
601if ((object)symbol == null || symbol.Name != names[i]) return false;
1459ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true },
1472ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true },
1480ContainingNamespace: { Name: "System", ContainingNamespace: { IsGlobalNamespace: true } },
1491ContainingNamespace: { Name: "System", ContainingNamespace: { IsGlobalNamespace: true } },
1502ContainingNamespace: { Name: "System", ContainingNamespace: { IsGlobalNamespace: true } },
1807if (name == tpEnclosing.Name)
1842if (typeParameter.Name == name)
1908var name = @namespace.Name;
2237if (typeSymbol.Name != name || typeSymbol.ContainingType is object)
2247if (typeSymbol.Name != name)
2259=> type.Name == "SetsRequiredMembersAttribute" && type.IsWellKnownDiagnosticsCodeAnalysisTopLevelType();
2278if (innerNamespace?.Name != innerNS)
2289if (midNamespace?.Name != midNS)
2295if (outerNamespace?.Name != outerNS)
2362switch (GeneratedNameParser.GetKind(type.Name))