Binder\Binder_Expressions.cs (25)
294diagnostics.Add(ErrorCode.ERR_SwitchExpressionNoBestType, exprSyntax.SwitchKeyword.GetLocation());
350diagnostics.Add(ErrorCode.ERR_DefaultLiteralNoTargetType, defaultExpr.Syntax.GetLocation());
410diagnostics.Add(ErrorCode.ERR_CannotInferDelegateType, syntax.GetLocation());
801diagnostics.Add(ErrorCode.ERR_InternalError, node.Location);
843diagnostics.Add(ErrorCode.ERR_ThrowMisplaced, node.ThrowKeyword.GetLocation());
1003diagnostics.Add(ErrorCode.ERR_VoidInTuple, argumentSyntax.Location);
1346diagnostics.Add(ErrorCode.ERR_BadDynamicTypeof, node.Location);
1352diagnostics.Add(ErrorCode.ERR_BadNullableTypeof, node.Location);
2899diagnostics.Add(ErrorCode.ERR_ScopedDiscard, scopedType.ScopedKeyword.GetLocation());
2905diagnostics.Add(ErrorCode.ERR_OutVariableCannotBeByRef, refType.Location);
2947diagnostics.Add(ErrorCode.ERR_OutVariableCannotBeByRef, refType.Location);
2972diagnostics.Add(ErrorCode.ERR_ScopedRefAndRefStructOnly, typeSyntax.Location);
4218diagnostics.Add(ErrorCode.ERR_NoDynamicPhantomOnBaseCtor, errorLocation);
4330diagnostics.Add(ErrorCode.ERR_ChainingToSetsRequiredMembersRequiresSetsRequiredMembers, errorLocation);
4380diagnostics.Add(ErrorCode.ERR_CopyConstructorMustInvokeBaseCopyConstructor, errorLocation);
4389diagnostics.Add(ErrorCode.ERR_CopyConstructorMustInvokeBaseCopyConstructor, errorLocation);
4437diagnostics.Add(ErrorCode.ERR_AnnotationDisallowedInObjectCreation, node.Location);
4472diagnostics.Add(ErrorCode.ERR_InvalidObjectCreation, node.Type.Location));
4514diagnostics.Add(ErrorCode.ERR_MethodNameExpected, loc);
4590diagnostics.Add(ErrorCode.ERR_MethodNameExpected, argument.Syntax.Location);
4651diagnostics.Add(ErrorCode.ERR_MethodNameExpected, argument.Syntax.Location);
4677diagnostics.Add(ErrorCode.ERR_NewWithTupleTypeSyntax, node.Type.GetLocation());
5060diagnostics.Add(ErrorCode.ERR_InterpolatedStringsReferencingInstanceCannotBeInObjectInitializers, argument.Syntax.Location);
7528diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportRefFields, node.Location);
8586diagnostics.Add(
Binder\Binder_Patterns.cs (16)
103diagnostics.Add(ErrorCode.WRN_GivenExpressionNeverMatchesPattern, node.Location);
110diagnostics.Add(ErrorCode.WRN_GivenExpressionAlwaysMatchesConstant, node.Location);
117diagnostics.Add(ErrorCode.WRN_GivenExpressionAlwaysMatchesPattern, node.Location);
211diagnostics.Add(ErrorCode.ERR_MisplacedSlicePattern, node.Location);
476diagnostics.Add(ErrorCode.ERR_DefaultPattern, e.Location);
483diagnostics.Add(ErrorCode.ERR_IllegalSuppression, e.Location);
560diagnostics.Add(ErrorCode.ERR_ConstantExpected, patternExpression.Location);
728diagnostics.Add(ErrorCode.ERR_PointerTypeInPatternMatching, typeSyntax.Location);
873diagnostics.Add(ErrorCode.ERR_DesignatorBeneathPatternCombinator, identifier.GetLocation());
958diagnostics.Add(ErrorCode.ERR_PointerTypeInPatternMatching, node.Location);
1084diagnostics.Add(ErrorCode.ERR_IdentifierExpected, subPattern.ExpressionColon.Expression.Location);
1111diagnostics.Add(ErrorCode.ERR_ArgumentNameInITuplePattern, subpatternSyntax.NameColon.Location);
1115diagnostics.Add(ErrorCode.ERR_IdentifierExpected, subpatternSyntax.ExpressionColon.Expression.Location);
1174diagnostics.Add(ErrorCode.ERR_IdentifierExpected, subpatternSyntax.ExpressionColon.Expression.Location);
1317diagnostics.Add(ErrorCode.ERR_PointerTypeInPatternMatching, node.Location);
1639diagnostics.Add(ErrorCode.ERR_RelationalPatternWithNaN, node.Expression.Location);
Binder\Binder_Statements.cs (14)
324diagnostics.Add(ErrorCode.ERR_BadEmbeddedStmt, node.GetLocation());
342diagnostics.Add(ErrorCode.ERR_BadEmbeddedStmt, node.GetLocation());
377diagnostics.Add(ErrorCode.WRN_PossibleMistakenNullStatement, node.GetLocation());
412diagnostics.Add(ErrorCode.ERR_BadExceptionType, exprSyntax.Location);
443diagnostics.Add(ErrorCode.ERR_BadEmptyThrow, node.ThrowKeyword.GetLocation());
454diagnostics.Add(ErrorCode.ERR_BadEmptyThrowInFinally, node.ThrowKeyword.GetLocation());
1104localDiagnostics.Add(ErrorCode.ERR_ScopedRefAndRefStructOnly, typeSyntax.Location);
1476diagnostics.Add(ErrorCode.ERR_VoidAssignment, op1.Syntax.Location);
2191diagnostics.Add(ErrorCode.ERR_InternalError, syntax.Location);
2912diagnostics.Add(ErrorCode.ERR_ReturnInIterator, syntax.ReturnKeyword.GetLocation());
2920diagnostics.Add(ErrorCode.ERR_MustNotHaveRefReturn, syntax.ReturnKeyword.GetLocation());
2925diagnostics.Add(ErrorCode.ERR_ReturnInIterator, syntax.ReturnKeyword.GetLocation());
2934diagnostics.Add(errorCode, syntax.ReturnKeyword.GetLocation());
3124diagnostics.Add(ErrorCode.ERR_TooManyCatches, catchSyntax.CatchKeyword.GetLocation());
Symbols\Source\ParameterHelpers.cs (18)
98diagnostics.Add(ErrorCode.ERR_NoVoidParameter, syntax.Type.Location);
145diagnostics.Add(ErrorCode.ERR_ThisInBadContext, thisKeyword.GetLocation());
160diagnostics.Add(ErrorCode.ERR_IllegalVarArgs, arglistToken.GetLocation());
166diagnostics.Add(ErrorCode.ERR_VarargsLast, concreteParam.GetLocation());
186diagnostics.Add(ErrorCode.ERR_IllegalRefParam, refnessKeyword.GetLocation());
427diagnostics.Add(ErrorCode.ERR_ThisInBadContext, modifier.GetLocation());
439diagnostics.Add(ErrorCode.ERR_BadParamModThis, modifier.GetLocation());
505diagnostics.Add(ErrorCode.ERR_IllegalParams, modifier.GetLocation());
513diagnostics.Add(ErrorCode.ERR_BadParamModThis, modifier.GetLocation());
579diagnostics.Add(ErrorCode.ERR_ReadOnlyNotSuppAsParamModDidYouMeanIn, modifier.GetLocation());
637diagnostics.Add(ErrorCode.ERR_IllegalParams, paramsKeyword.GetLocation());
642diagnostics.Add(ErrorCode.ERR_ParamsMustBeArray, paramsKeyword.GetLocation());
657diagnostics.Add(ErrorCode.ERR_DefaultValueBeforeRequiredValue, loc);
669diagnostics.Add(ErrorCode.ERR_ParamsLast, syntax.GetLocation());
674diagnostics.Add(ErrorCode.ERR_ScopedRefAndRefStructOnly, syntax.Location);
722diagnostics.Add(ErrorCode.ERR_RefOutDefaultValue, refnessKeyword.GetLocation());
728diagnostics.Add(ErrorCode.ERR_DefaultValueForParamsParameter, paramsKeyword.GetLocation());
738diagnostics.Add(ErrorCode.ERR_DefaultValueForExtensionParameter, thisKeyword.GetLocation());
Symbols\Source\SourceAssemblySymbol.cs (10)
594diagnostics.Add(ErrorCode.WRN_DelaySignButNoKey, NoLocation.Singleton);
601diagnostics.Add(ErrorCode.ERR_PublicSignNetModule, NoLocation.Singleton);
605diagnostics.Add(ErrorCode.ERR_PublicSignButNoKey, NoLocation.Singleton);
2187diagnostics.Add(ErrorCode.ERR_InvalidFwdType, GetAssemblyAttributeLocationForDiagnostic(arguments.AttributeSyntaxOpt));
2218diagnostics.Add(ErrorCode.ERR_InvalidFwdType, GetAssemblyAttributeLocationForDiagnostic(arguments.AttributeSyntaxOpt));
2256diagnostics.Add(ErrorCode.ERR_CannotPassNullForFriendAssembly, GetAssemblyAttributeLocationForDiagnostic(nodeOpt));
2356diagnostics.Add(ErrorCode.ERR_InvalidSignaturePublicKey, attribute.GetAttributeArgumentSyntaxLocation(0, arguments.AttributeSyntaxOpt));
2411diagnostics.Add(ErrorCode.ERR_InvalidAssemblyCultureForExe, attribute.GetAttributeArgumentSyntaxLocation(0, arguments.AttributeSyntaxOpt));
2415diagnostics.Add(ErrorCode.ERR_InvalidAssemblyCulture, attribute.GetAttributeArgumentSyntaxLocation(0, arguments.AttributeSyntaxOpt));
2527diagnostics.Add(ErrorCode.ERR_ExplicitExtension, arguments.AttributeSyntaxOpt.Location);
Symbols\Source\SourceComplexParameterSymbol.cs (19)
758diagnostics.Add(ErrorCode.ERR_DefaultValueUsedWithAttributes, arguments.AttributeSyntaxOpt.Name.Location);
764diagnostics.Add(ErrorCode.ERR_ExplicitParamArray, arguments.AttributeSyntaxOpt.Name.Location);
858diagnostics.Add(ErrorCode.ERR_UnscopedRefAttributeUnsupportedTarget, arguments.AttributeSyntaxOpt.Location);
862diagnostics.Add(ErrorCode.ERR_UnscopedScoped, arguments.AttributeSyntaxOpt.Location);
911diagnostics.Add(ErrorCode.ERR_ParamDefaultValueDiffersFromAttribute, syntax.Location);
944diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueUsedWithAttributes, node.Name.Location);
982diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueTypeMustMatch, node.Name.Location);
1002diagnosticsOpt.Add(ErrorCode.ERR_DefaultValueTypeMustMatch, node.Name.Location);
1070diagnostics.Add(ErrorCode.ERR_BadCallerLineNumberParamWithoutDefaultValue, node.Name.Location);
1098diagnostics.Add(ErrorCode.ERR_BadCallerFilePathParamWithoutDefaultValue, node.Name.Location);
1131diagnostics.Add(ErrorCode.ERR_BadCallerMemberNameParamWithoutDefaultValue, node.Name.Location);
1172diagnostics.Add(ErrorCode.ERR_BadCallerArgumentExpressionParamWithoutDefaultValue, node.Name.Location);
1249diagnostics.Add(ErrorCode.WRN_InterpolatedStringHandlerArgumentAttributeIgnoredOnLambdaParameters, errorLocation);
1277diagnostics.Add(ErrorCode.ERR_NullInvalidInterpolatedStringHandlerArgumentName, arguments.AttributeSyntaxOpt!.Location);
1321diagnostics.Add(ErrorCode.ERR_NullInvalidInterpolatedStringHandlerArgumentName, arguments.AttributeSyntaxOpt.Location);
1357diagnostics.Add(ErrorCode.ERR_CannotUseSelfAsInterpolatedStringHandlerArgument, errorLocation);
1397diagnostics.Add(ErrorCode.ERR_OutAttrOnRefParam, this.Locations[0]);
1404diagnostics.Add(ErrorCode.ERR_InAttrOnOutParam, this.Locations[0]);
1411diagnostics.Add(ErrorCode.ERR_OutAttrOnInParam, this.Locations[0]);
Symbols\Source\SourceMemberContainerSymbol.cs (24)
1837diagnostics.Add(ErrorCode.ERR_CloneDisallowedInRecord, member.Locations[0]);
2147diagnostics.Add(ErrorCode.ERR_InconsistentIndexerNames, indexer.Locations[0]);
2547diagnostics.Add(ErrorCode.ERR_ScriptsAndSubmissionsCannotHaveRequiredMembers, member.Locations[0]);
3427diagnostics.Add(ErrorCode.ERR_ConstructorInStaticClass, syntax.Identifier.GetLocation());
3441diagnostics.Add(ErrorCode.ERR_MultipleRecordParameterLists, parameterList.Location);
3481diagnostics.Add(ErrorCode.ERR_PartialMethodOnlyOneActual, methodPart.Locations[0]);
3487diagnostics.Add(ErrorCode.ERR_PartialMethodOnlyOneLatent, methodPart.Locations[0]);
3794diagnostics.Add(ErrorCode.ERR_InterfacesCantContainConstructors, member.Locations[0]);
3801diagnostics.Add(ErrorCode.ERR_OnlyClassesCanContainDestructors, member.Locations[0]);
3844diagnostics.Add(ErrorCode.ERR_EnumsCantContainDefaultConstructor, location);
3851diagnostics.Add(ErrorCode.ERR_NonPublicParameterlessStructConstructor, location);
3883diagnostics.Add(ErrorCode.ERR_StructHasInitializersAndNoDeclaredConstructor, Locations[0]);
4093diagnostics.Add(ErrorCode.ERR_RecordAmbigCtor, copyCtor.Locations[0]);
4654diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected,
4698diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected,
4712diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected,
4731diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected,
4749diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected,
4800diagnostics.Add(
4854diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected,
4874diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected,
4891diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected,
4906diagnostics.Add(ErrorCode.ERR_NamespaceUnexpected,
4967diagnostics.Add(ErrorCode.ERR_GlobalStatement, new SourceLocation(globalStatement));
Symbols\Source\SourceMemberFieldSymbol.cs (13)
60diagnostics.Add(ErrorCode.ERR_FieldCantHaveVoidType, TypeSyntax?.Location ?? this.Locations[0]);
190diagnostics.Add(ErrorCode.ERR_AbstractField, errorLocation);
360diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportDefaultInterfaceImplementation, ErrorLocation);
365diagnostics.Add(ErrorCode.ERR_InterfacesCantContainFields, ErrorLocation);
491diagnostics.Add(ErrorCode.ERR_RuntimeDoesNotSupportRefFields, ErrorLocation);
494diagnostics.Add(ErrorCode.ERR_RefFieldInNonRefStruct, ErrorLocation);
497diagnostics.Add(ErrorCode.ERR_RefFieldCannotReferToRefStruct, typeSyntax.SkipScoped(out _).Location);
511diagnosticsForFirstDeclarator.Add(ErrorCode.ERR_ImplicitlyTypedVariableCannotBeConst, typeSyntax.Location);
521diagnosticsForFirstDeclarator.Add(ErrorCode.ERR_ImplicitlyTypedVariableMultipleDeclarator, typeSyntax.Location);
561diagnostics.Add(ErrorCode.ERR_FixedNotInStruct, ErrorLocation);
566diagnostics.Add(ErrorCode.ERR_FixedFieldMustNotBeRef, ErrorLocation);
574diagnostics.Add(ErrorCode.ERR_IllegalFixedType, loc);
579diagnosticsForFirstDeclarator.Add(ErrorCode.ERR_UnsafeNeeded, declarator.Location);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (12)
591diagnostics.Add(ErrorCode.ERR_UnscopedRefAttributeUnsupportedMemberTarget, arguments.AttributeSyntaxOpt.Location);
667diagnostics.Add(ErrorCode.ERR_ConditionalOnInterfaceMethod, node.Location);
769diagnostics.Add(ErrorCode.ERR_DllImportOnInvalidMethod, arguments.AttributeSyntaxOpt.Name.Location);
785diagnostics.Add(ErrorCode.ERR_DllImportOnGenericMethod, arguments.AttributeSyntaxOpt.Name.Location);
890diagnostics.Add(ErrorCode.ERR_ModuleInitializerMethodMustBeOrdinary, arguments.AttributeSyntaxOpt.Location);
922diagnostics.Add(ErrorCode.ERR_ModuleInitializerCannotBeUnmanagedCallersOnly, arguments.AttributeSyntaxOpt.Location);
964diagnostics.Add(ErrorCode.ERR_CannotUseRefInUnmanagedCallersOnly, syntax.Location);
1039diagnostics.Add(ErrorCode.ERR_ComImportWithUserCtor, this.Locations[0]);
1100diagnostics.Add(ErrorCode.ERR_BadAsyncReturn, errorLocation);
1120diagnostics.Add(ErrorCode.ERR_SecurityCriticalOrSecuritySafeCriticalOnAsyncInClassOrStruct, errorLocation);
1129diagnostics.Add(ErrorCode.ERR_SynchronizedAsyncMethod, errorLocation);
1155diagnostics.Add(ErrorCode.ERR_MultipleEnumeratorCancellationAttributes, errorLocation);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (13)
250diagnostics.Add(ErrorCode.ERR_BadExtensionAgg, loc);
254diagnostics.Add(ErrorCode.ERR_BadExtensionMeth, location);
555diagnostics.Add(ErrorCode.ERR_IllegalVarianceSyntax, parameter.VarianceKeyword.GetLocation());
659diagnostics.Add(ErrorCode.ERR_PartialMethodReturnTypeDifference, implementation.Locations[0]);
669diagnostics.Add(ErrorCode.ERR_PartialMethodRefReturnDifference, implementation.Locations[0]);
674diagnostics.Add(ErrorCode.ERR_PartialMethodStaticDifference, implementation.Locations[0]);
679diagnostics.Add(ErrorCode.ERR_PartialMethodReadOnlyDifference, implementation.Locations[0]);
684diagnostics.Add(ErrorCode.ERR_PartialMethodExtensionDifference, implementation.Locations[0]);
689diagnostics.Add(ErrorCode.ERR_PartialMethodUnsafeDifference, implementation.Locations[0]);
694diagnostics.Add(ErrorCode.ERR_PartialMethodParamsDifference, implementation.Locations[0]);
700diagnostics.Add(ErrorCode.ERR_PartialMethodAccessibilityDifference, implementation.Locations[0]);
708diagnostics.Add(ErrorCode.ERR_PartialMethodExtendedModDifference, implementation.Locations[0]);
736diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInReturnTypeOnPartial, implementingMethod.Locations[0]);
Symbols\Source\SourcePropertySymbolBase.cs (11)
274diagnostics.Add(ErrorCode.ERR_InstancePropertyInitializerInInterface, location);
278diagnostics.Add(ErrorCode.ERR_InitializerOnNonAutoProperty, location);
673diagnostics.Add(ErrorCode.ERR_RefReturningPropertiesCannotBeRequired, Location);
684diagnostics.Add(ErrorCode.ERR_AutoPropsInRoStruct, Location);
698diagnostics.Add(ErrorCode.ERR_AutoPropertyCannotBeRefReturning, Location);
704diagnostics.Add(ErrorCode.ERR_AutoPropertyMustOverrideSet, Location);
720diagnostics.Add(ErrorCode.ERR_RefPropertyCannotHaveSetAccessor, _setMethod.Locations[0]);
749diagnostics.Add(ErrorCode.ERR_RefPropertyMustHaveGetAccessor, Location);
754diagnostics.Add(ErrorCode.ERR_AutoPropertyMustHaveGetAccessor, _setMethod!.Locations[0]);
1267diagnostics.Add(ErrorCode.ERR_ExplicitDynamicAttr, arguments.AttributeSyntaxOpt.Location);
1314diagnostics.Add(ErrorCode.ERR_UnscopedRefAttributeUnsupportedMemberTarget, arguments.AttributeSyntaxOpt.Location);
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (13)
56diagnostics.Add(ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators, this.Locations[0]);
243diagnostics.Add(ErrorCode.ERR_IllegalVarArgs, new SourceLocation(arglistToken));
333diagnostics.Add(ErrorCode.ERR_IllegalRefParam, this.Locations[0]);
467diagnostics.Add(IsAbstract || IsVirtual ? ErrorCode.ERR_AbstractConversionNotInvolvingContainedType : ErrorCode.ERR_ConversionNotInvolvingContainedType, this.Locations[0]);
478diagnostics.Add(ErrorCode.ERR_IdentityConversion, this.Locations[0]);
591diagnostics.Add(ErrorCode.ERR_OperatorCantReturnVoid, this.Locations[0]);
603diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadUnaryOperatorSignature, this.Locations[0]);
617diagnostics.Add(ErrorCode.ERR_OpTFRetType, this.Locations[0]);
623diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractUnaryOperatorSignature : ErrorCode.ERR_BadUnaryOperatorSignature, this.Locations[0]);
673diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractIncDecSignature : ErrorCode.ERR_BadIncDecSignature, this.Locations[0]);
682diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractIncDecRetType : ErrorCode.ERR_BadIncDecRetType, this.Locations[0]);
722diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractShiftOperatorSignature : ErrorCode.ERR_BadShiftOperatorSignature, this.Locations[0]);
741diagnostics.Add((IsAbstract || IsVirtual) ? ErrorCode.ERR_BadAbstractBinaryOperatorSignature : ErrorCode.ERR_BadBinaryOperatorSignature, this.Locations[0]);