268 references to Location
Microsoft.CodeAnalysis (5)
Binding\BindingDiagnosticBag.cs (3)
209=> Add(useSiteInfo, static node => node.Location, node); 212=> AddDiagnostics(useSiteInfo, static node => node.Location, node); 274=> Add(useSiteInfo, static node => node.Location, node);
CodeGen\ILBuilderEmit.cs (1)
758_diagnostics.Add(messageProvider.CreateDiagnostic(code, syntax?.Location ?? Location.None));
Emit\Context.cs (1)
23public Location? Location => _syntaxNode?.Location ?? SyntaxReference?.GetLocation();
Microsoft.CodeAnalysis.CSharp (254)
Binder\Binder.cs (3)
531diagnostics.Add(new CSDiagnostic(info, syntax.Location)); 541diagnostics.Add(new CSDiagnostic(new CSDiagnosticInfo(code), syntax.Location)); 546diagnostics.Add(new CSDiagnostic(new CSDiagnosticInfo(code, args), syntax.Location));
Binder\Binder.ValueChecks.cs (4)
1057diagnostics.Add(ErrorCode.WRN_AssignmentToLockOrDispose, local.Syntax.Location, localSymbol); 1073diagnostics.Add(ErrorCode.ERR_RefLocalOrParamExpected, node.Location); 1191diagnostics.Add(ErrorCode.WRN_AssignmentToLockOrDispose, parameter.Syntax.Location, parameterSymbol.Name); 5501diagnostics.Add(ErrorCode.ERR_InternalError, node.Location);
Binder\Binder_AnonymousTypes.cs (1)
94fieldSyntaxNodes[i].Location,
Binder\Binder_Conversions.cs (24)
307ReportUseSite(conversion.Method, diagnostics, syntax.Location); 539.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(Compilation, Conversions, includeNullability: false, syntax.Location, diagnostics)); 1059ReportUseSite(collectionBuilderMethod, diagnostics, syntax.Location); 1067new ConstraintsHelper.CheckConstraintsArgs(Compilation, Conversions, syntax.Location, diagnostics)); 1123diagnostics.Add(ErrorCode.ERR_NoNewAbstract, syntax.Location, namedType); 1140syntax.Location, 1182ReportConstructorUseSiteDiagnostics(node.Location, diagnostics, suppressUnsupportedRequiredMembersError: false, in overloadResolutionUseSiteInfo); 1212ReportConstructorUseSiteDiagnostics(typeNode.Location, diagnostics, suppressUnsupportedRequiredMembersError: false, in overloadResolutionUseSiteInfo); 1969source.Syntax.Location, 2306typeAndSyntax.Syntax.Location, 2322syntax.Location, 2410lambdaParameter.TryGetFirstLocation() ?? lambdaSymbol.SyntaxNode.Location); 2425ReportUnsafeIfNotAllowed(syntax.Location, diagnostics); 2646return !methodSymbol.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, node.Location, diagnostics)); 2699diagnostics.Add(ErrorCode.ERR_QueryNoProvider, node.Location, receiverOpt.Type, memberSymbol.Name); 2704diagnostics.Add(ErrorCode.ERR_ObjectRequired, node.Location, memberSymbol); 2713diagnostics.Add(ErrorCode.ERR_InitializerAddHasWrongSignature, node.Location, memberSymbol); 2718diagnostics.Add(ErrorCode.ERR_BadAwaitArg, node.Location, receiverOpt.Type); 2722diagnostics.Add(ErrorCode.ERR_ObjectProhibited, node.Location, memberSymbol); 2729diagnostics.Add(ErrorCode.ERR_ObjectRequired, node.Location, memberSymbol); 2743diagnostics.Add(code, errorNode.Location, memberSymbol); 3025if (!MethodIsCompatibleWithDelegateOrFunctionPointer(receiverOpt, isExtensionMethod, selectedMethod, delegateOrFuncPtrType, syntax.Location, diagnostics) || 3035Error(diagnostics, ErrorCode.ERR_DelegateOnConditional, syntax.Location, selectedMethod); 3043Error(diagnostics, ErrorCode.ERR_PartialMethodToDelegate, syntax.Location, selectedMethod);
Binder\Binder_Deconstruct.cs (3)
519locationsBuilder.Add(element.Syntax.Location); 570locationsBuilder.Add(variable.Syntax.Location); 583syntax.Location,
Binder\Binder_Expressions.cs (38)
329diagnostics.Add(op.NoCommonTypeError, op.Syntax.Location, trueArg, falseArg); 463diagnostics.Add(ErrorCode.WRN_CapturedPrimaryConstructorParameterInFieldInitializer, syntax.Location, parameter); 2791diagnostics.Add(ErrorCode.ERR_ConvertToStaticClass, syntax.Location, targetType); 2797diagnostics.Add(ErrorCode.ERR_ValueCantBeNull, syntax.Location, targetType); 2808diagnostics.Add(ErrorCode.ERR_AmbigUDConv, syntax.Location, originalUserDefinedConversions[0], originalUserDefinedConversions[1], operand.Display, targetType); 2815diagnostics.Add(ErrorCode.ERR_NoExplicitConv, syntax.Location, distinguisher1.First, distinguisher1.Second); 2826!MethodGroupConversionDoesNotExistOrHasErrors((BoundMethodGroup)operand, (NamedTypeSymbol)targetType, syntax.Location, diagnostics, out _)) 2828diagnostics.Add(ErrorCode.ERR_NoExplicitConv, syntax.Location, MessageID.IDS_SK_METHOD.Localize(), targetType); 2883diagnostics.Add(errorCode, syntax.Location, ((BoundUnconvertedAddressOfOperator)operand).Operand.Name, targetType); 2890diagnostics.Add(ErrorCode.ERR_NoExplicitConv, syntax.Location, distinguisher.First, distinguisher.Second); 3704diagnostics.Add(ErrorCode.ERR_InterpolatedStringHandlerArgumentAttributeMalformed, unconvertedString.Syntax.Location, correspondingParameter, handlerType); 3812unconvertedString.Syntax.Location, 3831arguments[argumentIndex].Syntax.Location, 5062diagnostics.Add(ErrorCode.WRN_CapturedPrimaryConstructorParameterPassedToBase, syntax.Location, parameter); 5363diagnostics.Add(ErrorCode.ERR_BadCtorArgCount, node.Location, type, 0); 5445hasErrors = MethodGroupConversionDoesNotExistOrHasErrors(methodGroup, type, node.Location, diagnostics, out conversion); 5452diagnostics.Add(ErrorCode.ERR_MethodNameExpected, argument.Syntax.Location); 5487diagnostics.Add(ErrorCode.ERR_MethDelegateMismatch, node.Location, 5513diagnostics.Add(ErrorCode.ERR_MethodNameExpected, argument.Syntax.Location); 5572diagnostics.Add(ErrorCode.ERR_InstantiatingStaticClass, node.Location, type); 5981diagnostics.Add(ErrorCode.ERR_InterpolatedStringsReferencingInstanceCannotBeInObjectInitializers, argument.Syntax.Location); 6214diagnostics.Add(ErrorCode.ERR_RequiredMembersMustBeAssignedValue, initializerExpression.Syntax.Location, requiredMember); 6234_ => creationSyntax.Location 6698diagnostics.Add(ErrorCode.ERR_NoNewAbstract, node.Location, type); 6757typeNode.Location, 6794ReportConstructorUseSiteDiagnostics(typeNode.Location, diagnostics, suppressUnsupportedRequiredMembersError: false, in overloadResolutionUseSiteInfo); 6877ReportConstructorUseSiteDiagnostics(typeNode.Location, diagnostics, suppressUnsupportedRequiredMembersError: false, in overloadResolutionUseSiteInfo); 6961diagnostics.Add(ErrorCode.ERR_NoNewAbstract, node.Location, type); 7073diagnostics.Add(ErrorCode.ERR_BadCtorArgCount, typeNode.Location, interfaceType, analyzedArguments.Arguments.Count); 7102diagnostics.Add(ErrorCode.ERR_NoNewTyvar, node.Location, typeParameter); 7117diagnostics.Add(ErrorCode.ERR_NewTyvarWithArgs, node.Location, typeParameter); 8210diagnostics.Add(new CSDiagnostic(lookupError, name.Location)); 8840diagnostics.Add(errorInfo, expression.Location); 8954diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportRefFields, node.Location); 9607diagnostics.Add(errorOpt ?? new CSDiagnosticInfo(ErrorCode.ERR_BadIndexLHS, expr.Display), node.Location); 10154location: syntax.Location, 11247var location = syntax.Location; 11435diagnostics.Add(new CSDiagnostic(diagnosticInfo, access.Syntax.Location));
Binder\Binder_InterpolatedString.cs (6)
112diagnostics.Add(ErrorCode.WRN_AlignmentMagnitude, alignment.Syntax.Location, alignmentConstant.Int32Value, magnitudeLimit); 804diagnostics.Add(ErrorCode.ERR_InterpolatedStringHandlerCreationCannotUseDynamic, syntax.Location, interpolatedStringHandlerType.Name); 939parameterNamesAndLocationsBuilder.Add(("alignment", insert.Alignment.Syntax.Location)); 945parameterNamesAndLocationsBuilder.Add(("format", insert.Format.Syntax.Location)); 989diagnostics.Add(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnMalformed, part.Syntax.Location, method); 999diagnostics.Add(ErrorCode.ERR_InterpolatedStringHandlerMethodReturnInconsistent, part.Syntax.Location, method, expected);
Binder\Binder_Invocation.cs (8)
172node.Location, 380diagnostics.Add(new CSDiagnosticInfo(ErrorCode.ERR_MethodNameExpected), expression.Location); 1015(typeArgumentsOpt.IsDefault || ((MethodSymbol)(object)result.Member).CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, syntax.Location, candidateDiagnostics)))) 1442diagnostics.Add(ErrorCode.ERR_BadAttributeParamDefaultArgument, syntax.Location, parameter.Name); 1668diagnostics.Add(ErrorCode.ERR_BadAttributeArgument, syntax.Location); 1733diagnostics.Add(ErrorCode.ERR_NotNullRefDefaultParameter, syntax.Location, parameter.Name, parameterType); 2363diagnostics.Add(ErrorCode.ERR_NameofExtensionMethod, methodGroup.Syntax.Location); 2470node.Location,
Binder\Binder_Operators.cs (2)
5778diagnostics.Add(ErrorCode.ERR_RefConditionalDifferentTypes, falseExpr.Syntax.Location, trueType); 5818diagnostics.Add(_inUnsafeRegion ? ErrorCode.WRN_MismatchedRefEscapeInTernary : ErrorCode.ERR_MismatchedRefEscapeInTernary, node.Location);
Binder\Binder_Patterns.cs (13)
67diagnostics.Add(ErrorCode.ERR_IsPatternImpossible, node.Location, expression.Type); 84diagnostics.Add(ErrorCode.WRN_IsPatternAlways, node.Location, expression.Type); 104diagnostics.Add(ErrorCode.WRN_GivenExpressionNeverMatchesPattern, node.Location); 111diagnostics.Add(ErrorCode.WRN_GivenExpressionAlwaysMatchesConstant, node.Location); 118diagnostics.Add(ErrorCode.WRN_GivenExpressionAlwaysMatchesPattern, node.Location); 437diagnostics.Add(ErrorCode.ERR_CannotMatchOnINumberBase, node.Location, inputType); 614diagnostics.Add(ErrorCode.ERR_ValueCantBeNull, expression.Syntax.Location, inputType); 624diagnostics.Add(ErrorCode.ERR_PatternWrongType, expression.Syntax.Location, inputType, expression.Display); 636expression.Syntax.Location, inputType, expression.Display, new CSharpRequiredLanguageVersion(requiredVersion)); 655if (MessageID.IDS_FeatureSpanCharConstantPattern.CheckFeatureAvailability(diagnostics, Compilation, node.Location)) 674diagnostics.Add(ErrorCode.ERR_PatternSpanCharCannotBeStringNull, convertedExpression.Syntax.Location, inputType); 738diagnostics.Add(ErrorCode.ERR_PointerTypeInPatternMatching, typeSyntax.Location); 1311diagnostics.Add(ErrorCode.ERR_TupleElementNameMismatch, node.Location, name, $"Item{tupleIndex + 1}");
Binder\Binder_Query.cs (8)
810node.Location 818new AnonymousTypeField(fieldName, fieldValue.Syntax.Location, TypeWithAnnotations.Create(TypeOrError(fieldValue)), RefKind.None, ScopedKind.None); 939diagnostics.Add(ErrorCode.ERR_NullNotValid, node.Location); 943diagnostics.Add(ErrorCode.ERR_DefaultLiteralNotValid, node.Location); 947diagnostics.Add(ErrorCode.ERR_ImplicitObjectCreationNotValid, node.Location); 951diagnostics.Add(ErrorCode.ERR_BadSKunknown, ultimateReceiver.Syntax.Location, ((BoundNamespaceExpression)ultimateReceiver).NamespaceSymbol, MessageID.IDS_SK_NAMESPACE.Localize()); 956diagnostics.Add(ErrorCode.ERR_QueryNoProvider, node.Location, MessageID.IDS_AnonMethod.Localize(), methodName); 978diagnostics.Add(ErrorCode.ERR_QueryNoProvider, node.Location, "void", methodName);
Binder\Binder_Statements.cs (7)
1310if (CheckManagedAddr(Compilation, elementType, initializerSyntax.Location, diagnostics)) 1342additionalDiagnostics.Add(ErrorCode.WRN_PatternBadSignature, initializer.Syntax.Location, initializer.Type, "fixed", patternMethodSymbol); 1467diagnostics.Add(ErrorCode.ERR_VoidAssignment, op1.Syntax.Location); 2011_ => node.Location, 2240diagnostics.Add(ErrorCode.ERR_InternalError, syntax.Location); 2473var location = nodeForError.Location; 3429return node.Location;
Binder\Binder_Symbols.cs (13)
1338diagnostics.Add(diagnosticInfo, node.Location); 1630type.CheckConstraintsForNamedType(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability, typeSyntax.Location, diagnostics), 1744diagnostics.Add(ErrorCode.ERR_MissingPredefinedMember, syntax.Location, descriptor.DeclaringTypeMetadataName, descriptor.Name); 1818return GetWellKnownType(type, diagnostics, node.Location); 1836return GetWellKnownType(compilation, type, diagnostics, node.Location); 2039diagnostics.Add(ErrorCode.WRN_SameFullNameThisNsAgg, where.Location, originalSymbols, 2050diagnostics.Add(ErrorCode.WRN_SameFullNameThisAggNs, where.Location, originalSymbols, 2061diagnostics.Add(ErrorCode.WRN_SameFullNameThisAggAgg, where.Location, originalSymbols, 2281diagnostics.Add(info, where.Location); 2302diagnostics.Add(errorInfo, where.Location); 2335diagnostics.Add(errorInfo, where.Location); 2383diagnostics.Add(new CSDiagnostic(result.Error, where.Location)); 2595var location = where.Location;
Binder\Binder_TupleOperators.cs (2)
318Location location = ((BoundTupleExpression)(useRight ? right : left)).Arguments[i].Syntax.Parent.Location; 407ImmutableArray<Location> elementLocations = elements.SelectAsArray(e => e.Syntax.Location);
Binder\Binder_Unsafe.cs (1)
36diagnostics.Add(new CSDiagnostic(diagnosticInfo, node.Location));
Binder\BindingDiagnosticBag.cs (2)
97return ReportUseSite(symbol, static node => node.Location, node); 162=> Add(code, syntax.Location, args);
Binder\ForEachLoopBinder.cs (20)
244messageId.CheckFeatureAvailability(diagnostics, Compilation, collectionExpr.Syntax.Location); 815diagnostics.Add(errorCode, collectionSyntax.Location, 941diagnostics.Add(ErrorCode.ERR_AnonMethGrpInForEach, collectionSyntax.Location, collectionExpr.Display); 958diagnostics.Add(ErrorCode.ERR_BadDynamicAwaitForEach, collectionSyntax.Location); 990diagnostics.Add(ErrorCode.ERR_ForEachMissingMember, collectionSyntax.Location, unwrappedCollectionExprType, WellKnownMemberNames.GetEnumeratorMethodName); 997diagnostics.Add(ErrorCode.ERR_AwaitForEachMissingMember, collectionSyntax.Location, unwrappedCollectionExprType, WellKnownMemberNames.GetAsyncEnumeratorMethodName); 1066diagnostics.Add(isAsync ? ErrorCode.ERR_BadGetAsyncEnumerator : ErrorCode.ERR_BadGetEnumerator, collectionSyntax.Location, getEnumeratorMethod.ReturnType, getEnumeratorMethod); 1087diagnostics.Add(isAsync ? ErrorCode.ERR_MultipleIAsyncEnumOfT : ErrorCode.ERR_MultipleIEnumOfT, errorLocationSyntax.Location, unwrappedCollectionExprType, 1114diagnostics, errorLocationSyntax.Location, isOptional: false); 1122diagnostics.Add(ErrorCode.ERR_AwaitForEachMissingMember, collectionSyntax.Location, unwrappedCollectionExprType, WellKnownMemberNames.GetAsyncEnumeratorMethodName); 1152diagnostics, errorLocationSyntax.Location, isOptional: false); 1159currentPropertyGetter = (MethodSymbol)GetWellKnownTypeMember(Compilation, WellKnownMember.System_Collections_Generic_IAsyncEnumerator_T__get_Current, diagnostics, errorLocationSyntax.Location, isOptional: false); 1208diagnostics.Add(ErrorCode.ERR_NullNotValid, collectionExpr.Syntax.Location); 1479diagnostics.Add(ErrorCode.WRN_PatternNotPublicOrNotInstance, collectionSyntax.Location, patternType, patternName.Localize(), result); 1514diagnostics.Add(ErrorCode.WRN_PatternIsAmbiguous, collectionSyntax.Location, patternType, MessageID.IDS_Collection.Localize(), 1607diagnostics.Add(ErrorCode.WRN_PatternIsAmbiguous, collectionSyntax.Location, collectionExpr.Type, MessageID.IDS_Collection.Localize(), 1614location: collectionSyntax.Location, 1766diagnostics.Add(ErrorCode.WRN_PatternBadSignature, collectionSyntax.Location, enumeratorType, MessageID.IDS_Collection.Localize(), patternMemberCandidate); 1937diagnostics.Add(lookupResult.Error, collectionSyntax.Location); 1943diagnostics.Add(ErrorCode.ERR_NoSuchMember, collectionSyntax.Location, patternType, memberName);
Binder\Semantics\Conversions\Conversions.cs (3)
355expr.Syntax.Location, 366expr.Syntax.Location, 378binder: binder, location: expr.Syntax.Location, nodeOpt: expr.Syntax, diagnostics: overloadDiagnostics,
Binder\SwitchBinder.cs (1)
266diagnostics.Add(ErrorCode.WRN_GotoCaseShouldConvert, node.Location, SwitchGoverningType);
Binder\SwitchBinder_Patterns.cs (1)
112diagnostics.Add(ErrorCode.ERR_DuplicateCaseLabel, syntax.Location, cp.ConstantValue.GetValueToDisplay());
Binder\SwitchExpressionBinder.cs (1)
71diagnostics.Add(ErrorCode.ERR_SwitchArmSubsumed, arm.Pattern.Syntax.Location);
Binder\UsingStatementBinder.cs (1)
204MessageID.IDS_FeatureDisposalPattern.CheckFeatureAvailability(diagnostics, originalBinder.Compilation, syntax.Location);
CodeGen\EmitConversion.cs (1)
394_diagnostics.Add(ErrorCode.ERR_BadDelegateConstructor, syntax.Location, delegateType);
Compilation\CSharpCompilation.cs (1)
1878diagnostics.Add(ErrorCode.ERR_SimpleProgramNotAnExecutable, simpleProgramEntryPointSymbol.ReturnTypeSyntax.Location);
Compilation\CSharpSemanticModel.cs (1)
5232var lineSpan = nameSyntax.Location.GetLineSpan().Span.Start;
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (3)
479location = originatingSyntax.Location; 508Location sourceLocation = originatingSyntax.Location; 530Location sourceLocation = originatingSyntax.Location;
Compiler\MethodBodySynthesizer.cs (1)
369syntax.Location));
Compiler\TypeCompilationState.cs (1)
232diagnostics.Add(ErrorCode.ERR_IndirectRecursiveConstructorCall, syntax.Location, method1);
Emitter\Model\PEModuleBuilder.cs (4)
825syntaxNodeOpt != null ? syntaxNodeOpt.Location : NoLocation.Singleton); 991diagnostics.Add(new CSDiagnostic(diagInfo ?? new CSDiagnosticInfo(ErrorCode.ERR_BogusType, string.Empty), syntaxNodeOpt == null ? NoLocation.Singleton : syntaxNodeOpt.Location)); 1095var location = syntaxNodeOpt == null ? NoLocation.Singleton : syntaxNodeOpt.Location; 1967Symbol.ReportUseSiteDiagnostic(info, diagnostics, syntaxNode.Location);
Emitter\NoPia\EmbeddedEvent.cs (2)
84diagnostics.Add(errorInfo, syntaxNodeOpt?.Location ?? NoLocation.Singleton); 116diagnostics.Add(syntaxNodeOpt == null ? NoLocation.Singleton : syntaxNodeOpt.Location, useSiteInfo.Diagnostics);
Emitter\NoPia\EmbeddedTypesManager.cs (4)
73syntaxNodeOpt != null ? syntaxNodeOpt.Location : NoLocation.Singleton); 110syntaxNodeOpt != null ? syntaxNodeOpt.Location : NoLocation.Singleton); 165diagnostics.Add(errorInfo, syntaxNodeOpt?.Location ?? NoLocation.Singleton); 344diagnostics.Add(new CSDiagnostic(info, syntaxOpt == null ? NoLocation.Singleton : syntaxOpt.Location));
Errors\DiagnosticBagExtensions.cs (1)
67return !useSiteDiagnostics.IsNullOrEmpty() && diagnostics.Add(node.Location, useSiteDiagnostics);
Errors\MessageID.cs (2)
367static tuple => tuple.location ?? tuple.syntax.Location, 395static tuple => tuple.location ?? tuple.syntax.Location,
FlowAnalysis\AbstractFlowPass.cs (1)
897Diagnostics.Add(ErrorCode.ERR_InternalError, node.Syntax.Location);
FlowAnalysis\ControlFlowPass.cs (1)
340var sourceLocation = node.Syntax.Location;
FlowAnalysis\DefiniteAssignment.cs (12)
1243Diagnostics.Add(ErrorCode.ERR_UseDefViolationOut, node.Location, symbolName); 1248Diagnostics.Add(ErrorCode.ERR_UseDefViolation, node.Location, symbolName); 1296Diagnostics.Add(ErrorCode.WRN_UseDefViolationThisSupportedVersion, node.Location); 1302node.Location, 1314Diagnostics.Add(hasAssociatedProperty ? ErrorCode.ERR_UseDefViolationProperty : ErrorCode.ERR_UseDefViolationField, node.Location, symbolName); 1324Diagnostics.Add(hasAssociatedProperty ? ErrorCode.ERR_UseDefViolationProperty : ErrorCode.ERR_UseDefViolationField, node.Location, symbolName); 1342node.Location, 1350node.Location, 1357node.Location, 1625LeaveParameter(param, node.Syntax, paramExpr.Syntax.Location); 2570_unsafeAddressTakenVariables.Add(variable, node.Syntax.Location); 2721_unsafeAddressTakenVariables.Add(receiver, node.Syntax.Location);
FlowAnalysis\NullableWalker.cs (8)
1342Diagnostics.Add(ErrorCode.WRN_ParameterConditionallyDisallowsNull, syntax.Location, parameter.Name, sense ? "true" : "false"); 7900ReportDiagnostic(ErrorCode.WRN_DisallowNullAttributeForbidsMaybeNullAssignment, node.Location); 8488Diagnostics.Add(pair.UseSiteInfo.DiagnosticInfo, syntax.Location); 8518Diagnostics.Add(pair.UseSiteInfo.DiagnosticInfo, syntax.Location); 8937var locations = tupleOpt.TupleElements.SelectAsArray((element, location) => element.TryGetFirstLocation() ?? location, node.Syntax.Location); 8941tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null), 10188ReportNullabilityMismatchWithTargetDelegate(group.Syntax.Location, delegateType, delegateInvokeMethod, method, node.IsExtensionMethod); 10260ReportNullabilityMismatchWithTargetDelegate(arg.Syntax.Location, delegateType, delegateInvokeMethod, argInvokeMethod, invokedAsExtensionMethod: false);
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (6)
356F.Diagnostics.Add(ErrorCode.ERR_WrongArityAsyncReturn, F.Syntax.Location, builderType); 367F.Diagnostics.Add(ErrorCode.ERR_BadAsyncReturn, F.Syntax.Location); 462F.Syntax.Location); 494F.Diagnostics.Add(ErrorCode.ERR_MissingPredefinedMember, F.Syntax.Location, builderType, methodName); 520F.Syntax.Location); 530F.Syntax.Location);
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
636onCompleted.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(F.Compilation, F.Compilation.Conversions, includeNullability: false, F.Syntax.Location, this.Diagnostics));
Lowering\AsyncRewriter\AsyncRewriter.cs (2)
132return Binder.GetWellKnownTypeMember(F.Compilation, member, bag, body.Syntax.Location); 258startMethod.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(F.Compilation, F.Compilation.Conversions, includeNullability: false, F.Syntax.Location, diagnostics));
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (1)
701_diagnostics.Add(ErrorCode.ERR_SpecialByRefInLambda, syntax.Location, type);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
120diagnostics.Add(ErrorCode.ERR_MissingPredefinedMember, node.Syntax.Location, r.ExpressionType, "Lambda");
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
61_diagnostics.Add(code, node.Syntax.Location, args);
Lowering\DiagnosticsPass_Warnings.cs (2)
333_diagnostics.Add(ErrorCode.WRN_BadRefCompareLeft, node.Syntax.Location, t); 338_diagnostics.Add(ErrorCode.WRN_BadRefCompareRight, node.Syntax.Location, t);
Lowering\IteratorRewriter\IteratorRewriter.cs (1)
166bag.ReportUseSite(getter, body.Syntax.Location);
Lowering\LocalRewriter\LocalRewriter.cs (1)
343location = node.Syntax.Location;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
133node.Syntax.Location, 746_factory.ModuleBuilderOpt.EnsureParamCollectionAttributeExists(_diagnostics, node.Location); 829rewrittenOperand.Syntax.Location,
Lowering\LocalRewriter\LocalRewriter_Event.cs (2)
37_diagnostics.Add(errorInfo, node.Syntax.Location); 278_diagnostics.Add(new CSDiagnosticInfo(ErrorCode.ERR_MissingPredefinedMember, invocationListProperty.ContainingType, accessorName), syntax.Location);
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (3)
87diagnostics.Add(ErrorCode.ERR_ByRefTypeAndAwait, syntax.Location, local.TypeWithAnnotations); 93diagnostics.Add(ErrorCode.ERR_RefLocalAcrossAwait, syntax.Location); 105diagnostics.Add(ErrorCode.ERR_ByRefTypeAndAwait, syntax.Location, parameter.TypeWithAnnotations);
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (2)
650F.Diagnostics.Add(ErrorCode.ERR_RefReturningCallAndAwait, F.Syntax.Location, call.Method); 668F.Diagnostics.Add(ErrorCode.ERR_RefConditionalAndAwait, F.Syntax.Location);
Lowering\SyntheticBoundNodeFactory.cs (3)
329var diagnostic = new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.ERR_MissingPredefinedMember, memberDescriptor.DeclaringTypeMetadataName, memberDescriptor.Name), Syntax.Location); 376var diagnostic = new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.ERR_MissingPredefinedMember, memberDescriptor.DeclaringTypeMetadataName, memberDescriptor.Name), Syntax.Location); 1227return Throw(Null(Binder.GetWellKnownType(Compilation, Microsoft.CodeAnalysis.WellKnownType.System_Exception, Diagnostics, Syntax.Location)));
Symbols\Attributes\SourceAttributeData.cs (1)
167return GetAttributeArgumentSyntax(parameterIndex).Location;
Symbols\ConstantValueUtils.cs (3)
91diagnostics.Add(ErrorCode.ERR_InvalidConstantDeclarationType, initValueNode.Location, thisSymbol, typeSymbol); 123diagnostics.Add(ErrorCode.ERR_NotNullConstRefField, initValueNode.Location, thisSymbol, typeSymbol); 139diagnostics.Add(ErrorCode.ERR_NotConstantExpression, initValueNode.Location, thisSymbol);
Symbols\ConstraintsHelper.cs (1)
663var location = ordinal == NamedTypeSymbol.ValueTupleRestIndex ? typeSyntax.Location : elementLocations[ordinal + offset];
Symbols\MethodSymbol.cs (2)
1047diagnostics?.Add(ErrorCode.ERR_UnmanagedCallersOnlyRequiresStatic, node!.Location); 1053diagnostics?.Add(ErrorCode.ERR_UnmanagedCallersOnlyMethodOrTypeCannotBeGeneric, node!.Location);
Symbols\Source\LambdaSymbol.cs (1)
224return ImmutableArray.Create<Location>(_syntax.Location);
Symbols\Source\ParameterHelpers.cs (1)
587internal static Location GetParameterLocation(ParameterSymbol parameter) => parameter.GetNonNullSyntaxNode().Location;
Symbols\Source\SourceComplexParameterSymbol.cs (2)
278parameterEqualsValue.Value.Syntax.Location); 926diagnostics.Add(ErrorCode.ERR_ParamDefaultValueDiffersFromAttribute, syntax.Location);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
1405diagnostics.Add(ErrorCode.ERR_CannotUseRefInUnmanagedCallersOnly, syntax.Location); 1421diagnostics.Add(ErrorCode.ERR_CannotUseManagedTypeInUnmanagedCallersOnly, syntax.Location, type, (isParam ? MessageID.IDS_Parameter : MessageID.IDS_Return).Localize());
Symbols\Source\SourceTypeParameterSymbol.cs (2)
280DeclaringCompilation.EnsureIsUnmanagedAttributeExists(diagnostics, this.GetNonNullSyntaxNode().Location, ModifyCompilationForAttributeEmbedding()); 317Location getLocation() => this.GetNonNullSyntaxNode().Location;
Symbols\Symbol.cs (2)
530foreach (var descendant in parent.DescendantNodesAndSelf(c => c.Location.SourceSpan.Contains(location.SourceSpan))) 532if (descendant is TNode && descendant.Location.SourceSpan.Contains(location.SourceSpan))
Symbols\Tuples\TupleTypeSymbol.cs (3)
65constructedType.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(compilation, compilation.Conversions, includeNullability, syntax.Location, diagnostics), 299diagnostics.Add(ErrorCode.WRN_TupleLiteralNameMismatch, literal.Arguments[i].Syntax.Parent!.Location, sourceName, destination); 503diagnostics.Add(useSiteInfo, static syntax => syntax?.Location ?? Location.None, syntax);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (7)
Diagnostics\DiagnosticAnalyzerTests.cs (3)
58context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_CA9999_UseOfVariableThatStartsWithX, id.Location, id.Identifier.ValueText)); 2343ReportDiagnosticsCore(addDiagnostic, node.Location, $"Node: {node.ToString()}"); 2348ReportDiagnosticsCore(addDiagnostic, operation.Syntax.Location, $"Operation: {name}");
Semantics\OutVarTests.cs (2)
35663Assert.Equal(tree, identifierBefore.Location.SourceTree); 35669Assert.Null(identifierAfter.Location.SourceTree);
Semantics\PatternMatchingTests2.cs (2)
2024var gotModel = model.TryGetSpeculativeSemanticModel(returnStatement.Location.SourceSpan.Start, modifiedReturnStatement, out var speculativeModel); 2065var gotModel = model.TryGetSpeculativeSemanticModel(returnStatement.Location.SourceSpan.Start, modifiedReturnStatement, out var speculativeModel);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\ImplicitObjectCreationTests.cs (2)
4158int nodeLocation = node.Location.SourceSpan.Start; 4185int nodeLocation = node.Location.SourceSpan.Start;