322 references to GetFirstLocation
Microsoft.CodeAnalysis.CSharp (322)
Binder\Binder_Conversions.cs (2)
2371Error(diagnostics, ErrorCode.WRN_OptionalParamValueMismatch, lambdaParameter.GetFirstLocation(), p + 1, lambdaParamDefault, delegateParamDefault ?? ((object)MessageID.IDS_Missing.Localize())); 2378Error(diagnostics, ErrorCode.WRN_ParamsArrayInLambdaOnly, lambdaParameter.GetFirstLocation(), p + 1);
Binder\Binder_Expressions.cs (3)
4821diagnostics.Add(ErrorCode.ERR_ObjectCallingBaseConstructor, constructor.GetFirstLocation(), containingType); 4832diagnostics.Add(ErrorCode.ERR_StructWithBaseConstructorCall, constructor.GetFirstLocation(), containingType); 4867errorLocation = constructor.GetFirstLocation();
Binder\Binder_NameConflicts.cs (1)
25=> symbol.TryGetFirstLocation() ?? symbol.ContainingSymbol.GetFirstLocation();
Binder\Binder_Query.cs (1)
773CheckFeatureAvailability(expression, MessageID.IDS_FeatureExpressionVariablesInQueriesAndInitializers, diagnostics, locals[0].GetFirstLocation());
Binder\Binder_Statements.cs (4)
225method.GetFirstLocation()); 582diagnostics.Add(ErrorCode.ERR_LocalFunctionMissingBody, localSymbol.GetFirstLocation(), localSymbol); 588diagnostics.Add(ErrorCode.ERR_ExternHasBody, localSymbol.GetFirstLocation(), localSymbol); 628blockDiagnostics.Add(ErrorCode.ERR_ReturnExpected, localSymbol.GetFirstLocation(), localSymbol);
Binder\Binder_Symbols.cs (2)
1891Location la = snd.GetFirstLocation(); 1892Location lb = fst.GetFirstLocation();
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
603if (InSpan(sym.GetFirstLocation(), this.syntaxTree, memberSpan))
Binder\ExecutableCodeBinder.cs (3)
114diagnostics.Add(ErrorCode.ERR_BadIteratorArgType, parameter.GetFirstLocation()); 118diagnostics.Add(ErrorCode.ERR_UnsafeIteratorArgType, parameter.GetFirstLocation()); 122Location errorLocation = (iterator as SynthesizedSimpleProgramEntryPointSymbol)?.ReturnTypeSyntax.GetLocation() ?? iterator.GetFirstLocation();
Binder\LocalBinderFactory.cs (1)
456if (candidate.GetFirstLocation() == node.Identifier.GetLocation())
Binder\LocalScopeBinder.cs (1)
513if (declaredInThisScope && newLocation.SourceSpan.Start >= local.GetFirstLocation().SourceSpan.Start)
Binder\WithLambdaParametersBinder.cs (1)
118var oldLocation = parameter.GetFirstLocation();
CommandLine\CSharpCompiler.cs (1)
262string entryPointFileName = PathUtilities.GetFileName(entryPoint.GetFirstLocation().SourceTree!.FilePath);
Compilation\CSharpCompilation.cs (5)
1953diagnostics.Add(ErrorCode.ERR_MainClassNotClass, mainTypeOrNamespace.GetFirstLocation(), mainTypeOrNamespace); 2002noMainFoundDiagnostics.Add(ErrorCode.WRN_InvalidMainSig, candidate.GetFirstLocation(), candidate); 2010noMainFoundDiagnostics.Add(ErrorCode.WRN_MainCantBeGeneric, candidate.GetFirstLocation(), candidate); 2112diagnostics.Add(ErrorCode.ERR_NoMainInClass, mainType.GetFirstLocation(), mainType); 3612var location = symbol.GetFirstLocation();
Compilation\SyntaxTreeSemanticModel.cs (3)
1812var loc = partial.GetFirstLocation(); 1936if (alias.Alias.GetFirstLocation().SourceSpan == declarationSyntax.Alias.Name.Span) 1969if (alias.Alias.GetFirstLocation().SourceSpan == declarationSyntax.Identifier.Span)
Compiler\ClsComplianceChecker.cs (18)
121Location warningLocation = i == 0 ? attributeLocation : module.GetFirstLocation(); 260this.AddDiagnostic(ErrorCode.WRN_CLS_BadAttributeType, symbol.GetFirstLocation(), symbol); 335this.AddDiagnostic(ErrorCode.WRN_CLS_NoVarArgs, symbol.GetFirstLocation()); 414this.AddDiagnostic(ErrorCode.WRN_CLS_VolatileField, symbol.GetFirstLocation(), symbol); 460this.AddDiagnostic(ErrorCode.WRN_CLS_MeaninglessOnPrivateType, symbol.GetFirstLocation(), symbol); 504this.AddDiagnostic(ErrorCode.WRN_CLS_BadInterfaceMember, symbol.GetFirstLocation(), symbol); 508this.AddDiagnostic(ErrorCode.WRN_CLS_NoAbstractMembers, symbol.GetFirstLocation(), symbol); 525this.AddDiagnostic(ErrorCode.WRN_CLS_BadInterface, symbol.GetFirstLocation(), symbol, interfaceType); 536this.AddDiagnostic(ErrorCode.WRN_CLS_BadBase, symbol.GetFirstLocation(), symbol, baseType); 549this.AddDiagnostic(ErrorCode.WRN_CLS_IllegalTrueInFalse, symbol.GetFirstLocation(), symbol, containingType); 566this.AddDiagnostic(ErrorCode.WRN_CLS_BadTypeVar, typeParameter.GetFirstLocation(), constraintType.Type); 580this.AddDiagnostic(ErrorCode.WRN_CLS_BadArgType, parameter.GetFirstLocation(), parameter.Type); 762this.AddDiagnostic(code, symbol.GetFirstLocation(), symbol); 795this.AddDiagnostic(code, symbol.GetFirstLocation(), symbol); 896this.AddDiagnostic(ErrorCode.WRN_CLS_BadIdentifierCase, symbol.GetFirstLocation(), symbol); 915this.AddDiagnostic(code, symbol.GetFirstLocation(), symbol); 921this.AddDiagnostic(ErrorCode.WRN_CLS_BadIdentifierCase, symbol.GetFirstLocation(), symbol); 956this.AddDiagnostic(ErrorCode.WRN_CLS_BadIdentifier, symbol.GetFirstLocation(), name);
Compiler\DocumentationCommentCompiler.cs (2)
385Location location = parameter.GetFirstLocation(); 400Location location = typeParameter.GetFirstLocation();
Compiler\MethodCompiler.cs (1)
1591diagnosticsForThisMethod.Add(ErrorCode.ERR_TooManyLocals, method.GetFirstLocation());
Emitter\Model\PEAssemblyBuilder.cs (1)
583diagnostics.Add(ErrorCode.ERR_TypeReserved, userDefinedAttribute.GetFirstLocation(), description.FullName);
FlowAnalysis\AbstractFlowPass.cs (1)
504location = method.GetFirstLocation();
FlowAnalysis\ControlFlowPass.cs (1)
343var targetStart = node.Label.GetFirstLocation().SourceSpan.Start;
FlowAnalysis\DataFlowsInWalker.cs (1)
95if (IsInside && !RegionContains(node.RangeVariableSymbol.GetFirstLocation().SourceSpan))
FlowAnalysis\DataFlowsOutWalker.cs (1)
233((param.RefKind != RefKind.None && !param.IsImplicitlyDeclared && !RegionContains(param.GetFirstLocation().SourceSpan)) ||
FlowAnalysis\FlowAnalysisPass.cs (1)
103diagnostics.Add(ErrorCode.ERR_ReturnExpected, method.GetFirstLocation(), method);
Lowering\AsyncRewriter\AsyncRewriter.cs (1)
66method.GetFirstLocation());
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
581_diagnostics.Add(ErrorCode.ERR_ExpressionTreeCantContainRefStruct, p.GetFirstLocation(), p.Type.Name); 586_diagnostics.Add(ErrorCode.ERR_LambdaWithAttributesToExpressionTree, p.GetFirstLocation());
Symbols\AliasSymbol.cs (2)
239target.CheckAllConstraints(DeclaringCompilation, conversions, GetFirstLocation(), diagnostics); 361diagnostics.Add(ErrorCode.ERR_BadExternAlias, GetFirstLocation(), Name);
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (1)
99Location location = anonymous.GetFirstLocation();
Symbols\ConstraintsHelper.cs (2)
101Location location = typeParameter.GetFirstLocation(); 118diagnostics.Add(ErrorCode.ERR_ClassIsCombinedWithRefStruct, typeParameter.GetFirstLocation());
Symbols\Source\ExplicitInterfaceHelpers.cs (6)
188var memberLocation = implementingMember.GetFirstLocation(); 358var memberLocation = implementingMember.GetFirstLocation(); 370diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, implementingMember.GetFirstLocation()); 411diagnostics.Add(ErrorCode.ERR_ExplicitImplCollisionOnRefOut, explicitInterfaceType.GetFirstLocation(), explicitInterfaceType, implementedMember); 416diagnostics.Add(ErrorCode.WRN_ExplicitImplCollision, implementingMember.GetFirstLocation(), implementingMember); 428diagnostics.Add(ErrorCode.WRN_ExplicitImplCollision, implementingMember.GetFirstLocation(), implementingMember);
Symbols\Source\ImplicitNamedTypeSymbol.cs (1)
63diagnostics.ReportUseSite(this.DeclaringCompilation.GetSpecialType(SpecialType.System_Object), GetFirstLocation());
Symbols\Source\LambdaSymbol.cs (1)
239_ => GetFirstLocation()
Symbols\Source\LocalFunctionSymbol.cs (1)
77_declarationDiagnostics.Add(ErrorCode.ERR_BadExtensionAgg, GetFirstLocation());
Symbols\Source\SourceComplexParameterSymbol.cs (4)
1412diagnostics.Add(ErrorCode.ERR_OutAttrOnRefParam, this.GetFirstLocation()); 1419diagnostics.Add(ErrorCode.ERR_InAttrOnOutParam, this.GetFirstLocation()); 1426diagnostics.Add(ErrorCode.ERR_OutAttrOnInParam, this.GetFirstLocation()); 1433diagnostics.Add(ErrorCode.ERR_OutAttrOnRefReadonlyParam, this.GetFirstLocation());
Symbols\Source\SourceConstructorSymbolBase.cs (2)
60var location = this.GetFirstLocation(); 98parameter.Type.CheckAllConstraints(compilation, conversions, parameter.GetFirstLocation(), diagnostics);
Symbols\Source\SourceCustomEventSymbol.cs (4)
139diagnostics.Add(ErrorCode.ERR_EventNeedsBothAccessors, this.GetFirstLocation(), this); 144diagnostics.Add(ErrorCode.ERR_ExplicitEventFieldImpl, this.GetFirstLocation()); 151Binder.CheckFeatureAvailability(syntax, MessageID.IDS_DefaultInterfaceImplementation, diagnostics, this.GetFirstLocation()); 155diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportDefaultInterfaceImplementation, this.GetFirstLocation());
Symbols\Source\SourceDelegateMethodSymbol.cs (5)
104diagnostics.Add(ErrorCode.ERR_BadVisDelegateReturn, delegateType.GetFirstLocation(), delegateType, invoke.ReturnType); 110diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, delegateType.GetFirstLocation(), invoke.ReturnType, delegateType); 119diagnostics.Add(ErrorCode.ERR_BadVisDelegateParam, delegateType.GetFirstLocation(), delegateType, parameterSymbol.Type); 123diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, delegateType.GetFirstLocation(), parameterSymbol.Type, delegateType); 127diagnostics.Add(delegateType.GetFirstLocation(), useSiteInfo);
Symbols\Source\SourceEnumConstantSymbol.cs (1)
220diagnostics.Add(ErrorCode.ERR_EnumeratorOverflow, this.GetFirstLocation(), this);
Symbols\Source\SourceEventAccessorSymbol.cs (1)
202return this.GetFirstLocation();
Symbols\Source\SourceEventSymbol.cs (3)
529Location location = this.GetFirstLocation(); 751var location = this.GetFirstLocation(); 780diagnostics.Add(ErrorCode.ERR_ExplicitPropertyAddingAccessor, thisAccessor.GetFirstLocation(), thisAccessor, explicitlyImplementedEvent);
Symbols\Source\SourceFieldLikeEventSymbol.cs (7)
70diagnostics.Add(ErrorCode.ERR_InterfaceEventInitializer, this.GetFirstLocation(), this); 74diagnostics.Add(ErrorCode.ERR_AbstractEventInitializer, this.GetFirstLocation(), this); 78diagnostics.Add(ErrorCode.ERR_ExternEventInitializer, this.GetFirstLocation(), this); 92diagnostics.Add(ErrorCode.ERR_FieldlikeEventsInRoStruct, this.GetFirstLocation()); 101diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportStaticAbstractMembersInInterfaces, this.GetFirstLocation()); 108diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportDefaultInterfaceImplementation, this.GetFirstLocation()); 113diagnostics.Add(ErrorCode.ERR_EventNeedsBothAccessors, this.GetFirstLocation(), this);
Symbols\Source\SourceFieldSymbol.cs (3)
220=> ImmutableArray.Create(GetFirstLocation()); 223=> GetFirstLocation(); 333diagnostics.Add(ErrorCode.ERR_CircConstValue, GetFirstLocation(), this);
Symbols\Source\SourceLocalSymbol.cs (1)
415=> ImmutableArray.Create(GetFirstLocation());
Symbols\Source\SourceMemberContainerSymbol.cs (75)
248diagnostics.Add(ErrorCode.ERR_PartialModifierConflict, GetFirstLocation(), this); 265diagnostics.Add(AccessCheck.GetProtectedMemberInSealedTypeError(ContainingType), GetFirstLocation(), this); 358diagnostics.Add(ErrorCode.ERR_AbstractSealedStatic, GetFirstLocation(), this); 364diagnostics.Add(ErrorCode.ERR_SealedStaticClass, GetFirstLocation(), this); 416modifierErrors = ModifierUtils.CheckAccessibility(mods, this, isExplicitInterfaceImplementation: false, diagnostics, this.GetFirstLocation()); 437diagnostics.Add(ErrorCode.ERR_FileTypeNoExplicitAccessibility, GetFirstLocation(), this); 1342diagnostics.Add(ErrorCode.ERR_PartialTypeKindConflict, t.GetFirstLocation(), t); 1346diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, t.GetFirstLocation(), this, t.Name); 1385diagnostics.Add(ErrorCode.ERR_MemberNameSameAsType, member.GetFirstLocation(), this.Name); 1812var location = GetFirstLocation(); 1936diagnostics.Add(ErrorCode.ERR_CloneDisallowedInRecord, member.GetFirstLocation()); 2045diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, symbol.GetFirstLocation(), this, symbol.Name); 2075diagnostics.Add(ErrorCode.ERR_DuplicateConversionInClass, conversion.GetFirstLocation(), this); 2161diagnostics.Add(ErrorCode.ERR_OverloadRefKind, method1.GetFirstLocation(), this, methodKind.Localize(), refKind1.ToParameterDisplayString(), refKind2.ToParameterDisplayString()); 2173diagnostics.Add(ErrorCode.ERR_MemberAlreadyExists, method1.GetFirstLocation(), methodName, this); 2215diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, indexer.GetFirstLocation(), this, indexerName); 2246diagnostics.Add(ErrorCode.ERR_InconsistentIndexerNames, indexer.GetFirstLocation()); 2259diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, indexer.GetFirstLocation(), this, indexerName); 2268diagnostics.Add(ErrorCode.ERR_MemberAlreadyExists, indexer.GetFirstLocation(), SyntaxFacts.GetText(SyntaxKind.ThisKeyword), this); 2302diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, dup.GetFirstLocation(), this, tp.Name); 2411diagnostics.Add(ErrorCode.ERR_StructLayoutCyclePrimaryConstructorParameter, parameterSymbol.GetFirstLocation(), parameterSymbol, type); 2419diagnostics.Add(ErrorCode.ERR_StructLayoutCycle, symbol.GetFirstLocation(), symbol, type); 2450diagnostics.Add(ErrorCode.ERR_ProtectedInStatic, member.GetFirstLocation(), member); 2523diagnostics.Add(ErrorCode.ERR_OperatorNeedsMatch, op1.GetFirstLocation(), op1, 2529diagnostics.Add(ErrorCode.ERR_CheckedOperatorNeedsMatch, op1.GetFirstLocation(), op1); 2610diagnostics.Add(ErrorCode.WRN_EqualsWithoutGetHashCode, this.GetFirstLocation(), this); 2616diagnostics.Add(ErrorCode.WRN_EqualityOpWithoutEquals, this.GetFirstLocation(), this); 2622diagnostics.Add(ErrorCode.WRN_EqualityOpWithoutGetHashCode, this.GetFirstLocation(), this); 2634_ = Binder.GetWellKnownTypeMember(DeclaringCompilation, WellKnownMember.System_Runtime_CompilerServices_RequiredMemberAttribute__ctor, diagnostics, GetFirstLocation()); 2639_ = Binder.GetWellKnownTypeMember(DeclaringCompilation, WellKnownMember.System_Runtime_CompilerServices_CompilerFeatureRequiredAttribute__ctor, diagnostics, GetFirstLocation()); 2644_ = Binder.GetWellKnownTypeMember(DeclaringCompilation, WellKnownMember.System_Diagnostics_CodeAnalysis_SetsRequiredMembersAttribute__ctor, diagnostics, GetFirstLocation()); 2658diagnostics.Add(ErrorCode.ERR_RequiredMembersBaseTypeInvalid, method.GetFirstLocation(), BaseTypeNoUseSiteDiagnostics); 2672diagnostics.Add(ErrorCode.ERR_ScriptsAndSubmissionsCannotHaveRequiredMembers, member.GetFirstLocation()); 2718diagnostics.Add(ErrorCode.ERR_StructLayoutCycle, f.GetFirstLocation(), f, type); 2782diagnostics.Add(ErrorCode.WRN_SequentialOnPartialClass, GetFirstLocation(), this); 2795diagnostics.Add(ErrorCode.WRN_SequentialOnPartialClass, GetFirstLocation(), this); 3667diagnostics.Add(ErrorCode.ERR_PartialMethodMustHaveLatent, method.GetFirstLocation(), method); 3671diagnostics.Add(ErrorCode.ERR_PartialMethodWithAccessibilityModsMustHaveImplementation, method.GetFirstLocation(), method); 3680property.GetFirstLocation(), 3702diagnostics.Add(ErrorCode.ERR_PartialMethodOnlyOneActual, currentMethod.GetFirstLocation()); 3708diagnostics.Add(ErrorCode.ERR_PartialMethodOnlyOneLatent, currentMethod.GetFirstLocation()); 3722diagnostics.Add(ErrorCode.ERR_PartialPropertyDuplicateImplementation, currentProperty.GetFirstLocation()); 3727diagnostics.Add(ErrorCode.ERR_PartialPropertyDuplicateDefinition, currentProperty.GetFirstLocation()); 3733diagnostics.Add(ErrorCode.ERR_PartialPropertyDuplicateInitializer, currentProperty.GetFirstLocation()); 3758diagnostics.Add(errorCode, propertyToBlame.GetFirstLocation(), foundAccessor); 3932return locationFrom.GetFirstLocation(); 3941return locationFrom.GetFirstLocation(); 4071diagnostics.Add(ErrorCode.ERR_InterfacesCantContainConstructors, member.GetFirstLocation()); 4078diagnostics.Add(ErrorCode.ERR_OnlyClassesCanContainDestructors, member.GetFirstLocation()); 4118var location = m.GetFirstLocation(); 4154MessageID.IDS_FeatureStructFieldInitializers.CheckFeatureAvailability(diagnostics, symbol.DeclaringCompilation, symbol.GetFirstLocation()); 4160diagnostics.Add(ErrorCode.ERR_StructHasInitializersAndNoDeclaredConstructor, GetFirstLocation()); 4274diagnostics.Add(ErrorCode.WRN_RecordEqualsWithoutGetHashCode, thisEquals.GetFirstLocation(), declaration.Name); 4327diagnostics.Add(ErrorCode.ERR_NonPublicAPIInRecord, deconstruct.GetFirstLocation(), deconstruct); 4332diagnostics.Add(ErrorCode.ERR_SignatureMismatchInRecord, deconstruct.GetFirstLocation(), deconstruct, targetMethod.ReturnType); 4337diagnostics.Add(ErrorCode.ERR_StaticAPIInRecord, deconstruct.GetFirstLocation(), deconstruct); 4372diagnostics.Add(ErrorCode.ERR_RecordAmbigCtor, copyCtor.GetFirstLocation()); 4381diagnostics.Add(ErrorCode.ERR_CopyConstructorWrongAccessibility, constructor.GetFirstLocation(), constructor); 4426diagnostics.Add(ErrorCode.ERR_NonPrivateAPIInRecord, printMembersMethod.GetFirstLocation(), printMembersMethod); 4431diagnostics.Add(ErrorCode.ERR_NonProtectedAPIInRecord, printMembersMethod.GetFirstLocation(), printMembersMethod); 4438diagnostics.Add(ErrorCode.ERR_SignatureMismatchInRecord, printMembersMethod.GetFirstLocation(), printMembersMethod, targetMethod.ReturnType); 4474var languageVersion = ((CSharpParseOptions)this.GetFirstLocation().SourceTree!.Options).LanguageVersion; 4478this.GetFirstLocation(), 4501toStringMethod.GetFirstLocation()); 4585param.GetFirstLocation(), 4614diagnostics.Add(ErrorCode.ERR_HiddenPositionalMember, param.GetFirstLocation(), symbol); 4654diagnostics.Add(ErrorCode.ERR_SealedAPIInRecord, getHashCode.GetFirstLocation(), getHashCode); 4688diagnostics.Add(ErrorCode.ERR_NonPrivateAPIInRecord, equalityContract.GetFirstLocation(), equalityContract); 4693diagnostics.Add(ErrorCode.ERR_NonProtectedAPIInRecord, equalityContract.GetFirstLocation(), equalityContract); 4700diagnostics.Add(ErrorCode.ERR_SignatureMismatchInRecord, equalityContract.GetFirstLocation(), equalityContract, targetProperty.Type); 4710diagnostics.Add(ErrorCode.ERR_EqualityContractRequiresGetter, equalityContract.GetFirstLocation(), equalityContract); 4754diagnostics.Add(ErrorCode.ERR_NonPublicAPIInRecord, thisEquals.GetFirstLocation(), thisEquals); 4759diagnostics.Add(ErrorCode.ERR_SignatureMismatchInRecord, thisEquals.GetFirstLocation(), thisEquals, targetMethod.ReturnType); 4774diagnostics.Add(ErrorCode.ERR_NotOverridableAPIInRecord, symbol.GetFirstLocation(), symbol); 4778diagnostics.Add(ErrorCode.ERR_StaticAPIInRecord, symbol.GetFirstLocation(), symbol);
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (19)
105diagnostics.Add(ErrorCode.ERR_UnimplementedAbstractMethod, this.GetFirstLocation(), this, abstractMember); 168Diagnostic diag = new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.ERR_DuplicateExplicitImpl, interfaceMember), this.GetFirstLocation()); 229var info = new CSDiagnosticInfo(ErrorCode.ERR_MixingWinRTEventWithRegular, args, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<Location>(this.GetFirstLocation())); 230diagnostics.Add(info, implementingEvent.GetFirstLocation()); 329? implementingMember.GetFirstLocation() 330: this.GetFirstLocation(); 347return GetImplementsLocation(implementedInterface) ?? this.GetFirstLocation(); 565diagnostics.Add(ErrorCode.ERR_CantOverrideSealed, method.GetFirstLocation(), method, overridden); 757var overridingMemberLocation = overridingMember.GetFirstLocation(); 860diagnostics.Add(ErrorCode.WRN_MultipleRuntimeOverrideMatches, ambiguousMethod.GetFirstLocation(), ambiguousMethod, overridingMember); 869var overridingMemberLocation = overridingMember.GetFirstLocation(); 1038if (Binder.ReportUseSite(overriddenMember, diagnostics, overridingMember.GetFirstLocation())) 1046var overridingMemberLocation = overridingProperty.GetFirstLocation(); 1099overridingProperty.GetMethod.GetFirstLocation(), 1109overridingProperty.SetMethod.GetFirstLocation(), 1253diagnostics.Add(ErrorCode.WRN_DoesNotReturnMismatch, overrideMethod.GetFirstLocation(), new FormattedSymbol(overrideMethod, SymbolDisplayFormat.MinimallyQualifiedFormat)); 1558var hidingMemberLocation = hidingMember.GetFirstLocation(); 1678diagnostics.Add(ErrorCode.ERR_HidingAbstractMethod, associatedPropertyOrEvent.GetFirstLocation(), associatedPropertyOrEvent, hiddenMember); 1772diagnostics.Add(ErrorCode.ERR_UnifyingInterfaceInstantiations, this.GetFirstLocation(), this, interface1, interface2);
Symbols\Source\SourceMemberFieldSymbol.cs (3)
60diagnostics.Add(ErrorCode.ERR_FieldCantHaveVoidType, TypeSyntax?.Location ?? this.GetFirstLocation()); 64diagnostics.Add(ErrorCode.ERR_FieldCantBeRefAny, TypeSyntax?.Location ?? this.GetFirstLocation(), type); 68diagnostics.Add(ErrorCode.ERR_FieldAutoPropCantBeByRefLike, TypeSyntax?.Location ?? this.GetFirstLocation(), type);
Symbols\Source\SourceMemberMethodSymbol.cs (5)
353diagnostics.Add(code, GetFirstLocation(), this, returnType.Type); 365diagnostics.Add(code, GetFirstLocation(), this, parameter.Type); 369diagnostics.Add(GetFirstLocation(), useSiteInfo); 381diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, GetFirstLocation(), returnType.Type, ContainingType); 388diagnostics.Add(ErrorCode.ERR_FileTypeDisallowedInSignature, GetFirstLocation(), param.Type, ContainingType);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (4)
1484diagnostics.Add(ErrorCode.ERR_ComImportWithUserCtor, this.GetFirstLocation()); 1493diagnostics.Add(ErrorCode.ERR_ComImportWithImpl, this.GetFirstLocation(), this, ContainingType); 1510diagnostics.Add(errorCode, this.GetFirstLocation(), this); 1519AsyncMethodChecks(verifyReturnType: true, this.GetFirstLocation(), diagnostics);
Symbols\Source\SourceNamedTypeSymbol.cs (13)
525diagnostics.Add(ErrorCode.ERR_PartialWrongConstraints, GetFirstLocation(), this, typeParameters[i]); 1591diagnostics.Add(ErrorCode.ERR_ComImportWithBase, this.GetFirstLocation(), this.Name); 1813diagnostics.Add(ErrorCode.WRN_ObsoleteMembersShouldNotBeRequired, member.GetFirstLocation(), member); 1820Binder.GetWellKnownTypeMember(DeclaringCompilation, WellKnownMember.System_Reflection_DefaultMemberAttribute__ctor, diagnostics, indexerSymbol.TryGetFirstLocation() ?? GetFirstLocation()); 1827diagnostics.Add(ErrorCode.ERR_InvalidInlineArrayLayout, GetFirstLocation()); 1836diagnostics.Add(ErrorCode.ERR_InlineArrayUnsupportedElementFieldModifier, elementField.TryGetFirstLocation() ?? GetFirstLocation()); 1850diagnostics.Add(ErrorCode.WRN_InlineArrayIndexerNotUsed, indexer.TryGetFirstLocation() ?? GetFirstLocation()); 1858diagnostics.Add(ErrorCode.WRN_InlineArraySliceNotUsed, slice.TryGetFirstLocation() ?? GetFirstLocation()); 1881diagnostics.Add(ErrorCode.WRN_InlineArrayConversionOperatorNotUsed, conversion.TryGetFirstLocation() ?? GetFirstLocation()); 1890diagnostics.Add(ErrorCode.WRN_InlineArrayNotSupportedByLanguage, elementField.TryGetFirstLocation() ?? GetFirstLocation()); 1894diagnostics.Add(ErrorCode.WRN_InlineArrayNotSupportedByLanguage, GetFirstLocation()); 1900diagnostics.Add(ErrorCode.ERR_InvalidInlineArrayFields, GetFirstLocation()); 1905diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportInlineArrayTypes, GetFirstLocation());
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (6)
341var info = diagnostics.Add(ErrorCode.ERR_PartialMultipleBases, GetFirstLocation(), this); 421diagnostics.Add(GetFirstLocation(), useSiteInfo); 679diagnostics.Add(ErrorCode.ERR_CycleInInterfaceInheritance, GetFirstLocation(), this, t))); 703diagnostics.Add(GetFirstLocation(), useSiteInfo); 757diagnostics.Add(ErrorCode.ERR_CircularBase, GetFirstLocation(), declaredBase, this)); 777diagnostics.Add(useSiteInfo.Diagnostics.IsNullOrEmpty() ? Location.None : (FindBaseRefSyntax(declaredBase) ?? GetFirstLocation()), useSiteInfo);
Symbols\Source\SourceNamedTypeSymbol_Enum.cs (1)
77Binder.ReportUseSite(defaultUnderlyingType, diagnostics, this.GetFirstLocation());
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (2)
301diagnostics.Add(ErrorCode.ERR_DuplicateAlias, pair.Value.Alias.GetFirstLocation(), pair.Key); 370diagnostics.Add(ErrorCode.ERR_DuplicateAlias, externAlias.Alias.GetFirstLocation(), externAlias.Alias.Name);
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (2)
233this.ReturnType.CheckAllConstraints(compilation, conversions, this.GetFirstLocation(), diagnostics); 237parameter.Type.CheckAllConstraints(compilation, conversions, parameter.GetFirstLocation(), diagnostics);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (17)
482diagnostics.Add(ErrorCode.ERR_PartialMethodReturnTypeDifference, implementation.GetFirstLocation()); 487diagnostics.Add(ErrorCode.ERR_PartialMemberInconsistentTupleNames, implementation.GetFirstLocation(), definition, implementation); 492diagnostics.Add(ErrorCode.ERR_PartialMemberRefReturnDifference, implementation.GetFirstLocation()); 497diagnostics.Add(ErrorCode.ERR_PartialMemberStaticDifference, implementation.GetFirstLocation()); 502diagnostics.Add(ErrorCode.ERR_PartialMemberReadOnlyDifference, implementation.GetFirstLocation()); 507diagnostics.Add(ErrorCode.ERR_PartialMethodExtensionDifference, implementation.GetFirstLocation()); 512diagnostics.Add(ErrorCode.ERR_PartialMemberUnsafeDifference, implementation.GetFirstLocation()); 517diagnostics.Add(ErrorCode.ERR_PartialMemberParamsDifference, implementation.GetFirstLocation()); 523diagnostics.Add(ErrorCode.ERR_PartialMemberAccessibilityDifference, implementation.GetFirstLocation()); 531diagnostics.Add(ErrorCode.ERR_PartialMemberExtendedModDifference, implementation.GetFirstLocation()); 542diagnostics.Add(ErrorCode.ERR_ScopedMismatchInParameterOfPartial, implementingMethod.GetFirstLocation(), new FormattedSymbol(implementingParameter, SymbolDisplayFormat.ShortFormat)); 559diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInReturnTypeOnPartial, implementingMethod.GetFirstLocation()); 563diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInParameterTypeOnPartial, implementingMethod.GetFirstLocation(), new FormattedSymbol(implementingParameter, SymbolDisplayFormat.ShortFormat)); 573diagnostics.Add(ErrorCode.WRN_PartialMethodTypeDifference, implementation.GetFirstLocation(), 611diagnostics.Add(ErrorCode.ERR_PartialMethodInconsistentConstraints, implementation.GetFirstLocation(), implementation, typeParameter2.Name); 615diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInConstraintsOnPartialImplementation, implementation.GetFirstLocation(), implementation, typeParameter2.Name); 675diagnostics.Add(report, typeParameter.GetFirstLocation(), this, typeParameter,
Symbols\Source\SourcePropertyAccessorSymbol.cs (3)
853diagnostics.Add(ErrorCode.ERR_PartialMemberAccessibilityDifference, implementationAccessor.GetFirstLocation()); 858diagnostics.Add(ErrorCode.ERR_PartialMemberReadOnlyDifference, implementationAccessor.GetFirstLocation()); 864diagnostics.Add(ErrorCode.ERR_PartialPropertyInitMismatch, implementationAccessor.GetFirstLocation(), implementationAccessor, accessorName);
Symbols\Source\SourcePropertySymbol.cs (12)
693diagnostics.Add(ErrorCode.ERR_PartialPropertyTypeDifference, implementation.GetFirstLocation()); 698diagnostics.Add(ErrorCode.ERR_PartialMemberInconsistentTupleNames, implementation.GetFirstLocation(), this, implementation); 704diagnostics.Add(ErrorCode.ERR_PartialMemberRefReturnDifference, implementation.GetFirstLocation()); 710diagnostics.Add(ErrorCode.WRN_PartialPropertySignatureDifference, implementation.GetFirstLocation(), 717diagnostics.Add(ErrorCode.ERR_PartialPropertyRequiredDifference, implementation.GetFirstLocation()); 722diagnostics.Add(ErrorCode.ERR_PartialMemberStaticDifference, implementation.GetFirstLocation()); 727diagnostics.Add(ErrorCode.ERR_PartialMemberReadOnlyDifference, implementation.GetFirstLocation()); 732diagnostics.Add(ErrorCode.ERR_PartialMemberUnsafeDifference, implementation.GetFirstLocation()); 737diagnostics.Add(ErrorCode.ERR_PartialMemberParamsDifference, implementation.GetFirstLocation()); 743diagnostics.Add(ErrorCode.ERR_PartialMemberAccessibilityDifference, implementation.GetFirstLocation()); 751diagnostics.Add(ErrorCode.ERR_PartialMemberExtendedModDifference, implementation.GetFirstLocation()); 763diagnostics.Add(ErrorCode.ERR_ScopedMismatchInParameterOfPartial, implementation.GetFirstLocation(), new FormattedSymbol(implementation.Parameters[i], SymbolDisplayFormat.ShortFormat));
Symbols\Source\SourcePropertySymbolBase.cs (8)
352diagnostics.Add(ErrorCode.WRN_AccessorDoesNotUseBackingField, accessorToBlame.GetFirstLocation(), accessorName, property); 928diagnostics.Add(ErrorCode.ERR_RefPropertyCannotHaveSetAccessor, _setMethod.GetFirstLocation()); 965diagnostics.Add(ErrorCode.ERR_AutoPropertyMustHaveGetAccessor, _setMethod!.GetFirstLocation()); 1132diagnostics.Add(ErrorCode.ERR_InvalidPropertyAccessMod, accessor.GetFirstLocation(), accessor, this); 1154diagnostics.Add(ErrorCode.ERR_PrivateAbstractAccessor, accessor.GetFirstLocation(), accessor); 1177diagnostics.Add(ErrorCode.ERR_ExplicitPropertyAddingAccessor, thisAccessor.GetFirstLocation(), thisAccessor, explicitlyImplementedProperty); 1182diagnostics.Add(ErrorCode.ERR_ExplicitPropertyMismatchInitOnly, thisAccessor.GetFirstLocation(), thisAccessor, otherAccessor); 1769parameter.Type.CheckAllConstraints(DeclaringCompilation, conversions, parameter.GetFirstLocation(), diagnostics);
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (22)
59diagnostics.Add(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, this.GetFirstLocation()); 79diagnostics.Add(ErrorCode.ERR_ExplicitImplementationOfOperatorsMustBeStatic, this.GetFirstLocation(), this); 85diagnostics.Add(ErrorCode.ERR_OperatorsMustBeStatic, this.GetFirstLocation(), this); 336diagnostics.Add(ErrorCode.ERR_IllegalRefParam, this.GetFirstLocation()); 456diagnostics.Add(ErrorCode.ERR_ConversionWithInterface, this.GetFirstLocation(), this); 470diagnostics.Add(IsAbstract || IsVirtual ? ErrorCode.ERR_AbstractConversionNotInvolvingContainedType : ErrorCode.ERR_ConversionNotInvolvingContainedType, this.GetFirstLocation()); 481diagnostics.Add(ErrorCode.ERR_IdentityConversion, this.GetFirstLocation()); 549diagnostics.Add(ErrorCode.ERR_BadDynamicConversion, this.GetFirstLocation(), this); 577diagnostics.Add(ErrorCode.ERR_ConversionWithBase, this.GetFirstLocation(), this); 582diagnostics.Add(ErrorCode.ERR_ConversionWithDerived, this.GetFirstLocation(), this); 585diagnostics.Add(this.GetFirstLocation(), useSiteInfo); 594diagnostics.Add(ErrorCode.ERR_OperatorCantReturnVoid, this.GetFirstLocation()); 606diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadUnaryOperatorSignature, this.GetFirstLocation()); 620diagnostics.Add(ErrorCode.ERR_OpTFRetType, this.GetFirstLocation()); 626diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadUnaryOperatorSignature, this.GetFirstLocation()); 676diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractIncDecSignature : ErrorCode.ERR_BadIncDecSignature, this.GetFirstLocation()); 685diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractIncDecRetType : ErrorCode.ERR_BadIncDecRetType, this.GetFirstLocation()); 688diagnostics.Add(this.GetFirstLocation(), useSiteInfo); 725diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractShiftOperatorSignature : ErrorCode.ERR_BadShiftOperatorSignature, this.GetFirstLocation()); 729var location = this.GetFirstLocation(); 744diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractBinaryOperatorSignature : ErrorCode.ERR_BadBinaryOperatorSignature, this.GetFirstLocation()); 755diagnostics.Add(ErrorCode.ERR_BadAbstractEqualityOperatorSignature, this.GetFirstLocation(), this.ContainingType);
Symbols\Source\TypeParameterBuilder.cs (1)
48diagnostics.Add(ErrorCode.ERR_TypeVariableSameAsParent, result.GetFirstLocation(), result.Name);
Symbols\SymbolExtensions.cs (1)
293symbol.CheckUnsafeModifier(modifiers, symbol.GetFirstLocation(), diagnostics);
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (1)
47diagnostics.Add(ErrorCode.ERR_DoesNotOverrideBaseMethod, GetFirstLocation(), this, ContainingType.BaseTypeNoUseSiteDiagnostics);
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (4)
44containingType.GetFirstLocation(), 62=> ContainingType.GetFirstLocation(); 70ContainingType.GetFirstLocation(), 127diagnostics.Add(ErrorCode.ERR_DoesNotOverrideBaseEqualityContract, overriding.GetFirstLocation(), overriding, overriding.ContainingType.BaseTypeNoUseSiteDiagnostics);
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperatorBase.cs (2)
39: base(MethodKind.UserDefinedOperator, explicitInterfaceType: null, name, containingType, containingType.GetFirstLocation(), (CSharpSyntaxNode)containingType.SyntaxReferences[0].GetSyntax(), 48protected sealed override Location ReturnTypeLocation => GetFirstLocation();
Symbols\Synthesized\Records\SynthesizedRecordObjectMethod.cs (1)
54diagnostics.Add(ErrorCode.ERR_DoesNotOverrideMethodFromObject, overriding.GetFirstLocation(), overriding);
Symbols\Synthesized\Records\SynthesizedRecordOrdinaryMethod.cs (2)
24: base(containingType, name, containingType.GetFirstLocation(), (CSharpSyntaxNode)containingType.SyntaxReferences[0].GetSyntax(), 45protected sealed override Location ReturnTypeLocation => GetFirstLocation();
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (2)
112diagnostics.Add(ErrorCode.ERR_DoesNotOverrideBaseMethod, GetFirstLocation(), this, ContainingType.BaseTypeNoUseSiteDiagnostics); 290diagnostics.Add(ErrorCode.ERR_DoesNotOverrideBaseMethod, overriding.GetFirstLocation(), overriding, baseType);
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (1)
42backingParameter.GetFirstLocation(),
Symbols\Tuples\TupleErrorFieldSymbol.cs (1)
211_locations.IsEmpty ? null : GetFirstLocation(),
Symbols\TypeSymbol.cs (6)
856diagnostics.Add(ErrorCode.ERR_DuplicateExplicitImpl, implementingType.GetFirstLocation(), interfaceMember); 1780implementingEvent.GetFirstLocation(), new FormattedSymbol(implementedEvent, SymbolDisplayFormat.MinimallyQualifiedFormat)); 1811implementingMethod.GetFirstLocation(), new FormattedSymbol(implementedMethod.ConstructedFrom, SymbolDisplayFormat.MinimallyQualifiedFormat)); 1832implementingMethod.GetFirstLocation(), 2134return member.GetFirstLocation(); 2140return snt?.GetImplementsLocation(@interface) ?? implementingType.GetFirstLocation();
Symbols\VarianceSafety.cs (4)
92diagnostics.Add(ErrorCode.ERR_VarianceInterfaceNesting, member.GetFirstLocation()); 228locationProvider: e => e.GetFirstLocation(), 268locationProvider: t => t.GetFirstLocation(), 466var location = locationProvider(locationArg) ?? unsafeTypeParameter.GetFirstLocation();