237 references to DiagnosticId
illink (237)
Linker.Dataflow\CompilerGeneratedState.cs (7)
136
List<(MessageOrigin,
DiagnosticId
, string[])>? _warnings = null;
141
void AddWarning(MessageOrigin origin,
DiagnosticId
id, params string[] messageArgs)
143
_warnings ??= new List<(MessageOrigin,
DiagnosticId
, string[])>();
191
AddWarning(new MessageOrigin(method),
DiagnosticId
.MethodsAreAssociatedWithUserMethod, method.GetDisplayName(), alreadyAssociatedMethod.GetDisplayName(), generatedType.GetDisplayName());
250
AddWarning(new MessageOrigin(method),
DiagnosticId
.MethodsAreAssociatedWithStateMachine, method.GetDisplayName(), alreadyAssociatedMethod.GetDisplayName(), stateMachineType.GetDisplayName());
306
AddWarning(new MessageOrigin(userDefinedMethod),
DiagnosticId
.MethodsAreAssociatedWithUserMethod, userDefinedMethod.GetDisplayName(), alreadyAssociatedMethod.GetDisplayName(), nestedFunction.GetDisplayName());
336
AddWarning(new MessageOrigin(method),
DiagnosticId
.MethodsAreAssociatedWithUserMethod, method.GetDisplayName(), alreadyAssociatedMethod.GetDisplayName(), generatedType.GetDisplayName());
Linker.Dataflow\DiagnosticContext.cs (2)
17
public partial void AddDiagnostic(
DiagnosticId
id, params string[] args)
24
public partial void AddDiagnostic(
DiagnosticId
id, ValueWithDynamicallyAccessedMembers actualValue, ValueWithDynamicallyAccessedMembers expectedAnnotationsValue, params string[] args)
Linker.Dataflow\FlowAnnotations.cs (15)
212
_context.LogWarning(member,
DiagnosticId
.AttributeDoesntHaveTheRequiredNumberOfParameters, "System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute");
238
_context.LogWarning(field,
DiagnosticId
.DynamicallyAccessedMembersOnFieldCanOnlyApplyToTypesOrStrings, field.GetDisplayName());
259
_context.LogWarning(method,
DiagnosticId
.DynamicallyAccessedMembersIsNotAllowedOnMethods);
271
_context.LogWarning(method,
DiagnosticId
.DynamicallyAccessedMembersIsNotAllowedOnMethods);
273
_context.LogWarning(method,
DiagnosticId
.DynamicallyAccessedMembersOnMethodParameterCanOnlyApplyToTypesOrStrings,
285
_context.LogWarning(method,
DiagnosticId
.DynamicallyAccessedMembersOnMethodReturnValueCanOnlyApplyToTypesOrStrings, method.GetDisplayName());
334
_context.LogWarning(property,
DiagnosticId
.DynamicallyAccessedMembersOnPropertyCanOnlyApplyToTypesOrStrings, property.GetDisplayName());
365
_context.LogWarning(setMethod,
DiagnosticId
.DynamicallyAccessedMembersConflictsBetweenPropertyAndAccessor, property.GetDisplayName(), setMethod.GetDisplayName());
409
_context.LogWarning(getMethod,
DiagnosticId
.DynamicallyAccessedMembersConflictsBetweenPropertyAndAccessor, property.GetDisplayName(), getMethod.GetDisplayName());
424
_context.LogWarning(property,
DiagnosticId
.DynamicallyAccessedMembersCouldNotFindBackingField, property.GetDisplayName());
436
_context.LogWarning(backingField,
DiagnosticId
.DynamicallyAccessedMembersOnPropertyConflictsWithBackingField, property.GetDisplayName(), backingField.GetDisplayName());
631
_context.LogWarning(origin,
DiagnosticId
.DynamicallyAccessedMembersMismatchOnMethodParameterBetweenOverrides,
636
_context.LogWarning(origin,
DiagnosticId
.DynamicallyAccessedMembersMismatchOnMethodReturnValueBetweenOverrides,
641
_context.LogWarning(origin,
DiagnosticId
.DynamicallyAccessedMembersMismatchOnImplicitThisBetweenOverrides,
646
_context.LogWarning(origin,
DiagnosticId
.DynamicallyAccessedMembersMismatchOnGenericParameterBetweenOverrides,
Linker.Dataflow\HandleCallAction.cs (2)
63
_diagnosticContext.AddDiagnostic(
DiagnosticId
.CorrectnessOfCOMCannotBeGuaranteed, calledMethod.GetDisplayName());
265
_diagnosticContext.AddDiagnostic(
DiagnosticId
.UnresolvedAssemblyInCreateInstance,
Linker.Dataflow\MethodBodyScanner.cs (2)
206
(int)
DiagnosticId
.LinkerUnexpectedError,
945
(int)
DiagnosticId
.LinkerUnexpectedError,
Linker.Steps\BodySubstitutionParser.cs (10)
61
LogWarning(methodNav,
DiagnosticId
.XmlCouldNotFindMethodOnType, signature, type.GetDisplayName());
77
LogWarning(methodNav,
DiagnosticId
.XmlInvalidValueForStub, method.GetDisplayName());
87
LogWarning(methodNav,
DiagnosticId
.XmlUnkownBodyModification, action, method.GetDisplayName());
102
LogWarning(fieldNav,
DiagnosticId
.XmlCouldNotFindFieldOnType, name, type.GetDisplayName());
108
LogWarning(fieldNav,
DiagnosticId
.XmlSubstitutedFieldNeedsToBeStatic, field.GetDisplayName());
115
LogWarning(fieldNav,
DiagnosticId
.XmlMissingSubstitutionValueForField, field.GetDisplayName());
120
LogWarning(fieldNav,
DiagnosticId
.XmlInvalidSubstitutionValueForField, value, field.GetDisplayName());
145
LogWarning(resourceNav,
DiagnosticId
.XmlMissingNameAttributeInResource);
152
LogWarning(resourceNav,
DiagnosticId
.XmlInvalidValueForAttributeActionForResource, action, name);
159
LogWarning(resourceNav,
DiagnosticId
.XmlCouldNotFindResourceToRemoveInAssembly, name, assembly.Name.Name);
Linker.Steps\CheckSuppressionsDispatcher.cs (4)
26
.Where(suppression => ((
DiagnosticId
)suppression.SuppressMessageInfo.Id).GetDiagnosticCategory() == DiagnosticCategory.Trimming)
27
.Where(suppression => ((
DiagnosticId
)suppression.SuppressMessageInfo.Id) !=
DiagnosticId
.RedundantSuppression)
34
context.LogWarning(new MessageOrigin(source),
DiagnosticId
.RedundantSuppression, $"IL{suppression.SuppressMessageInfo.Id:0000}");
Linker.Steps\DescriptorMarker.cs (5)
92
LogWarning(namespaceNav,
DiagnosticId
.XmlCouldNotFindAnyTypeInNamespace, fullname);
137
LogWarning(nav,
DiagnosticId
.TypeHasNoFieldsToPreserve, type.GetDisplayName());
141
LogWarning(nav,
DiagnosticId
.TypeHasNoMethodsToPreserve, type.GetDisplayName());
280
LogWarning(nav,
DiagnosticId
.XmlCouldNotFindGetAccesorOfPropertyOnType, property.Name, type.FullName);
285
LogWarning(nav,
DiagnosticId
.XmlCouldNotFindSetAccesorOfPropertyOnType, property.Name, type.FullName);
Linker.Steps\LinkAttributesParser.cs (17)
56
LogWarning(attributeNav,
DiagnosticId
.UnrecognizedInternalAttribute, internalAttribute);
61
LogWarning(attributeNav,
DiagnosticId
.XmlRemoveAttributeInstancesCanOnlyBeUsedOnType, nameof(RemoveAttributeInstancesAttribute));
74
LogWarning(attributeNav,
DiagnosticId
.XmlElementDoesNotContainRequiredAttributeFullname);
173
LogWarning(nav,
DiagnosticId
.XmlCouldNotFindMatchingConstructorForCustomAttribute, attributeType.GetDisplayName());
223
LogWarning(propertyNav,
DiagnosticId
.XmlPropertyDoesNotContainAttributeName);
230
LogWarning(propertyNav,
DiagnosticId
.XmlCouldNotFindProperty, propertyName);
276
_context.LogError(null,
DiagnosticId
.CustomAttributeArgumentForTypeRequiresNestedNode, "System.Object", "argument");
320
_context.LogError(GetMessageOriginForPosition(nav),
DiagnosticId
.CouldNotResolveCustomAttributeTypeValue, svalue);
353
_context.LogError(GetMessageOriginForPosition(nav),
DiagnosticId
.UnexpectedAttributeArgumentType, typeref.GetDisplayName());
366
_context.LogError(GetMessageOriginForPosition(nav),
DiagnosticId
.UnexpectedAttributeArgumentType, typeref.GetDisplayName());
379
_context.LogError(GetMessageOriginForPosition(nav),
DiagnosticId
.TypeUsedWithAttributeValueCouldNotBeFound, typeName, nav.Value);
441
_context.LogError(null,
DiagnosticId
.CannotConverValueToType, value.ToString() ?? "", targetType.GetDisplayName());
461
LogWarning(nav,
DiagnosticId
.XmlCouldNotResolveAssemblyForAttribute, assemblyName, attributeFullName);
469
LogWarning(nav,
DiagnosticId
.XmlCouldNotResolveAssemblyForAttribute, assemblyName, attributeFullName);
479
LogWarning(nav,
DiagnosticId
.XmlAttributeTypeCouldNotBeFound, attributeFullName);
554
LogWarning(parameterNav,
DiagnosticId
.XmlMoreThanOneValueForParameterOfMethod, paramName, method.GetDisplayName());
581
LogWarning(returnNav,
DiagnosticId
.XmlMoreThanOneReturnElementForMethod, method.GetDisplayName());
Linker.Steps\MarkExportedTypesTargetStep.cs (1)
32
context.LogError(null,
DiagnosticId
.ExportedTypeCannotBeResolved, exportedType.Name);
Linker.Steps\MarkStep.cs (31)
924
Context.LogWarning(origin,
DiagnosticId
.UnresolvedAssemblyInDynamicDependencyAttribute, dynamicDependency.AssemblyName);
940
Context.LogWarning(origin,
DiagnosticId
.UnresolvedTypeInDynamicDependencyAttribute, typeName);
951
Context.LogWarning(origin,
DiagnosticId
.UnresolvedTypeInDynamicDependencyAttribute, typeReference.GetDisplayName());
960
Context.LogWarning(context,
DiagnosticId
.UnresolvedTypeInDynamicDependencyAttribute, context.DeclaringType.GetDisplayName());
971
Context.LogWarning(origin,
DiagnosticId
.NoMembersResolvedForMemberSignatureOrType, memberSignature, type.GetDisplayName());
981
Context.LogWarning(origin,
DiagnosticId
.NoMembersResolvedForMemberSignatureOrType, memberTypes.ToString(), type.GetDisplayName());
1024
Context.LogWarning(context,
DiagnosticId
.DeprecatedPreserveDependencyAttribute);
1036
Context.LogWarning(context,
DiagnosticId
.CouldNotResolveDependencyAssembly, assemblyName);
1053
Context.LogWarning(context,
DiagnosticId
.CouldNotResolveDependencyType, typeName);
1098
Context.LogWarning(context,
DiagnosticId
.CouldNotResolveDependencyMember, member ?? "", td.GetDisplayName());
1752
Context.LogWarning(origin,
DiagnosticId
.DynamicallyAccessedMembersMethodAccessedViaReflection, method.GetDisplayName());
1788
var
id = reportOnMember ?
DiagnosticId
.DynamicallyAccessedMembersOnTypeReferencesMemberWithRequiresUnreferencedCode :
DiagnosticId
.DynamicallyAccessedMembersOnTypeReferencesMemberOnBaseWithRequiresUnreferencedCode;
1798
var
id = reportOnMember ?
DiagnosticId
.DynamicallyAccessedMembersOnTypeReferencesMemberWithDynamicallyAccessedMembers :
DiagnosticId
.DynamicallyAccessedMembersOnTypeReferencesMemberOnBaseWithDynamicallyAccessedMembers;
1900
Context.LogWarning(origin,
DiagnosticId
.DynamicallyAccessedMembersFieldAccessedViaReflection, field.GetDisplayName());
2095
Context.LogWarning(origin,
DiagnosticId
.AttributeIsReferencedButTrimmerRemoveAllInstances, type.GetDisplayName());
2128
Context.LogWarning(typeOrigin,
DiagnosticId
.RequiresUnreferencedCodeOnBaseClass, type.GetDisplayName(), type.BaseType.GetDisplayName(), arg1, arg2);
2945
Context.LogWarning(type,
DiagnosticId
.TypeHasNoFieldsToPreserve, type.GetDisplayName());
2949
Context.LogWarning(type,
DiagnosticId
.TypeHasNoMethodsToPreserve, type.GetDisplayName());
3291
diagnosticContext.AddDiagnostic(
DiagnosticId
.RequiresUnreferencedCode, displayName, arg1, arg2);
3340
Context.LogWarning(methodOrigin,
DiagnosticId
.RequiresUnreferencedCodeOnStaticConstructor, method.GetDisplayName());
3342
Context.LogWarning(methodOrigin,
DiagnosticId
.RequiresUnreferencedCodeOnEntryPoint, method.GetDisplayName());
3540
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(origin,
DiagnosticId
.CannotStubConstructorWhenBaseTypeDoesNotHaveConstructor, method.DeclaringType.GetDisplayName()));
3557
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(null,
DiagnosticId
.CouldNotFindType, "System.NotSupportedException"));
3563
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(null,
DiagnosticId
.CouldNotFindConstructor, nse.GetDisplayName()));
3573
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(null,
DiagnosticId
.CouldNotFindConstructor, objectType.GetDisplayName()));
3583
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(null,
DiagnosticId
.CouldNotFindType, "System.Runtime.CompilerServices.DisablePrivateReflectionAttribute"));
3590
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(null,
DiagnosticId
.CouldNotFindConstructor, disablePrivateReflection.GetDisplayName()));
Linker.Steps\OutputStep.cs (1)
114
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(null,
DiagnosticId
.FailedToWriteOutput, outputName), e);
Linker.Steps\ProcessLinkerXmlBase.cs (14)
100
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(null,
DiagnosticId
.ErrorProcessingXmlLocation, _xmlDocumentLocation), ex);
125
LogWarning(assemblyNav,
DiagnosticId
.XmlUnsuportedWildcard);
136
LogWarning(assemblyNav,
DiagnosticId
.AssemblyWithEmbeddedXmlApplyToAnotherAssembly, _resource.Value.Assembly.Name.Name, name.ToString());
158
LogWarning(assemblyNav,
DiagnosticId
.XmlCouldNotResolveAssembly, name!.Name);
206
LogWarning(typeNav,
DiagnosticId
.XmlCouldNotResolveType, fullname);
286
LogWarning(nav,
DiagnosticId
.XmlCouldNotFindFieldOnType, signature, type.GetDisplayName());
311
LogWarning(nav,
DiagnosticId
.XmlCouldNotFindFieldOnType, name, type.GetDisplayName());
348
LogWarning(nav,
DiagnosticId
.XmlCouldNotFindMethodOnType, signature, type.GetDisplayName());
373
LogWarning(nav,
DiagnosticId
.XmlCouldNotFindMethodOnType, name, type.GetDisplayName());
400
LogWarning(nav,
DiagnosticId
.XmlCouldNotFindEventOnType, signature, type.GetDisplayName());
422
LogWarning(nav,
DiagnosticId
.XmlCouldNotFindEventOnType, name, type.GetDisplayName());
459
LogWarning(nav,
DiagnosticId
.XmlCouldNotFindPropertyOnType, signature, type.GetDisplayName());
481
LogWarning(nav,
DiagnosticId
.XmlCouldNotFindPropertyOnType, name, type.GetDisplayName());
536
protected void LogWarning(XPathNavigator position,
DiagnosticId
id, params string[] args)
Linker.Steps\ProcessReferencesStep.cs (1)
43
Context.LogError(null,
DiagnosticId
.ReferenceAssemblyCouldNotBeLoaded, assemblyPath);
Linker.Steps\RootAssemblyInputStep.cs (3)
41
Context.LogError(null,
DiagnosticId
.RootAssemblyCannotUseAction, assembly.Name.ToString(), action.ToString());
51
Context.LogError(null,
DiagnosticId
.RootAssemblyDoesNotHaveEntryPoint, assembly.Name.ToString());
116
Context.LogError(null,
DiagnosticId
.RootAssemblyCouldNotBeFound, fileName);
Linker.Steps\ValidateVirtualMethodAnnotationsStep.cs (1)
63
Context.LogWarning(origin,
DiagnosticId
.RequiresUnreferencedCodeAttributeMismatch, message);
Linker\AssemblyResolver.cs (1)
146
_context.LogError(null,
DiagnosticId
.CouldNotFindAssemblyReference, reference.Name);
Linker\Driver.cs (33)
201
Context.LogError(null,
DiagnosticId
.MissingArgumentForCommanLineOptionName, optionName);
240
context.LogError(null,
DiagnosticId
.UnrecognizedCommandLineOption, token);
280
context.LogError(null,
DiagnosticId
.InvalidAssemblyName, assemblyName);
297
context.LogError(null,
DiagnosticId
.InvalidDependenciesFileFormat);
375
context.LogError(null,
DiagnosticId
.InvalidAssemblyName, assemblyName);
413
context.LogError(null,
DiagnosticId
.CustomDataFormatIsInvalid);
580
context.LogError(null,
DiagnosticId
.InvalidGenerateWarningSuppressionsValue, generateWarningSuppressionsArgument);
650
context.LogError(null,
DiagnosticId
.InvalidAssemblyName, assemblyName);
672
context.LogError(null,
DiagnosticId
.InvalidAssemblyName, assemblyName);
731
context.LogError(null,
DiagnosticId
.XmlDescriptorCouldNotBeFound, xmlFile);
745
context.LogError(null,
DiagnosticId
.RootAssemblyCouldNotBeFound, assemblyFile);
794
context.LogError(null,
DiagnosticId
.UnrecognizedCommandLineOption, token);
800
context.LogError(null,
DiagnosticId
.NoFilesToLinkSpecified, resolvers);
806
context.LogError(null,
DiagnosticId
.NewMvidAndDeterministicCannotBeUsedAtSameTime);
828
context.LogError(null,
DiagnosticId
.InvalidDependenciesFileFormat);
954
Context.LogError(null,
DiagnosticId
.FailedToResolveMetadataElement, re.Message);
957
Context.LogError(null,
DiagnosticId
.LinkerUnexpectedError);
1002
Context.LogError(null,
DiagnosticId
.AssemblyInCustomStepOptionCouldNotBeFound, arg);
1005
Context.LogError(null,
DiagnosticId
.AssemblyPathInCustomStepMustBeFullyQualified, arg);
1080
Context.LogError(null,
DiagnosticId
.InvalidArgForCustomStep, arg);
1087
Context.LogError(null,
DiagnosticId
.ExpectedSignToControlNewStepInsertion);
1112
Context.LogError(null,
DiagnosticId
.PipelineStepCouldNotBeFound, targetName);
1137
Context.LogError(null,
DiagnosticId
.PipelineStepCouldNotBeFound, targetName);
1149
Context.LogError(null,
DiagnosticId
.CustomStepTypeIsIncompatibleWithLinkerVersion, stepType.ToString());
1186
Context.LogError(null,
DiagnosticId
.CustomStepTypeCouldNotBeFound, type);
1202
Context.LogError(null,
DiagnosticId
.CustomStepTypeCouldNotBeFound, type);
1208
Context.LogError(null,
DiagnosticId
.CustomStepTypeIsIncompatibleWithLinkerVersion, type);
1257
Context.LogError(null,
DiagnosticId
.InvalidAssemblyAction, s);
1275
Context.LogError(null,
DiagnosticId
.InvalidAssemblyRootMode, s);
1288
Context.LogError(null,
DiagnosticId
.InvalidWarningVersion, text);
1323
Context.LogError(null,
DiagnosticId
.InvalidOptimizationValue, text);
1343
Context.LogError(null,
DiagnosticId
.InvalidMetadataOption, text);
1388
Context.LogError(null,
DiagnosticId
.InvalidArgumentForTokenOption, token);
Linker\DynamicDependency.cs (1)
80
context.LogWarning(member,
DiagnosticId
.DynamicDependencyAttributeCouldNotBeAnalyzed);
Linker\EmbeddedXmlInfo.cs (3)
43
context.LogError(null,
DiagnosticId
.XmlException, rsc.Name, ex.ToString());
66
context.LogError(null,
DiagnosticId
.XmlException, rsc.Name, ex.ToString());
94
context.LogError(null,
DiagnosticId
.XmlException, rsc.Name, ex.ToString());
Linker\FeatureSettings.cs (3)
21
context.LogError(null,
DiagnosticId
.XmlFeatureDoesNotSpecifyFeatureValue, documentLocation, feature);
27
context.LogError(null,
DiagnosticId
.XmlUnsupportedNonBooleanValueForFeature, documentLocation, feature);
35
context.LogError(null,
DiagnosticId
.XmlDocumentLocationHasInvalidFeatureDefault, documentLocation);
Linker\LinkContext.cs (10)
462
LogWarning(GetAssemblyLocation(assembly),
DiagnosticId
.InvalidIsTrimmableValue, args[1].Value.ToString() ?? "", assembly.Name.Name);
614
public void LogWarning(MessageOrigin origin,
DiagnosticId
id, params string[] args)
644
internal void LogWarning(IMemberDefinition origin,
DiagnosticId
id, int ilOffset = MessageOrigin.UnsetILOffset, params string[] args)
658
public void LogWarning(IMemberDefinition origin,
DiagnosticId
id, params string[] args)
687
public void LogWarning(string origin,
DiagnosticId
id, params string[] args)
712
public void LogError(MessageOrigin? origin,
DiagnosticId
id, params string[] args)
1043
LogError(string.Format(SharedStrings.FailedToResolveFieldElementMessage, fieldReference.FullName), (int)
DiagnosticId
.FailedToResolveMetadataElement);
1049
LogError(string.Format(SharedStrings.FailedToResolveMethodElementMessage, methodReference.GetDisplayName()), (int)
DiagnosticId
.FailedToResolveMetadataElement);
1055
LogError(string.Format(SharedStrings.FailedToResolveTypeElementMessage, typeReference.GetDisplayName()), (int)
DiagnosticId
.FailedToResolveMetadataElement);
1061
LogError(string.Format(SharedStrings.FailedToResolveTypeElementMessage, et.Name), (int)
DiagnosticId
.FailedToResolveMetadataElement);
Linker\LinkerAttributesInformation.cs (2)
87
context.LogWarning(provider,
DiagnosticId
.AttributeShouldOnlyBeUsedOnceOnMember, attributeValueType.FullName ?? "", (provider is MemberReference memberRef) ? memberRef.GetDisplayName() : provider.FullName);
139
context.LogWarning((IMemberDefinition)provider,
DiagnosticId
.AttributeDoesntHaveTheRequiredNumberOfParameters, typeof(RequiresUnreferencedCodeAttribute).FullName ?? "");
Linker\MessageContainer.cs (5)
66
internal static MessageContainer CreateErrorMessage(MessageOrigin? origin,
DiagnosticId
id, params string[] args)
127
internal static MessageContainer CreateWarningMessage(LinkContext context, MessageOrigin origin,
DiagnosticId
id, WarnVersion version, params string[] args)
180
private static MessageContainer CreateWarningMessageContainer(LinkContext context, MessageOrigin origin,
DiagnosticId
id, WarnVersion version, string subcategory, params string[] args)
243
context.LogWarning(context.GetAssemblyLocation(assembly),
DiagnosticId
.AssemblyProducedTrimWarnings, assemblyName);
282
private MessageContainer(MessageCategory category,
DiagnosticId
id, string subcategory = MessageSubCategory.None, MessageOrigin? origin = null, params string[] args)
Linker\TypeNameResolver.WithDiagnostics.cs (1)
34
diagnosticContext.AddDiagnostic(
DiagnosticId
.TypeNameIsNotAssemblyQualified, typeNameString);
Linker\UnconditionalSuppressMessageAttributeState.cs (1)
347
_context.LogWarning(_context.GetAssemblyLocation(module.Assembly),
DiagnosticId
.InvalidScopeInUnconditionalSuppressMessage, info.Scope ?? "", module.Name, info.Target ?? "");
src\tools\illink\src\ILLink.Shared\Annotations.cs (32)
87
public static (
DiagnosticId
Id, string[] Arguments) GetDiagnosticForAnnotationMismatch(ValueWithDynamicallyAccessedMembers source, ValueWithDynamicallyAccessedMembers target, string missingAnnotations)
99
DiagnosticId
diagnosticId = (source, target) switch
101
(MethodParameterValue maybeThisSource, MethodParameterValue maybeThisTarget) when maybeThisSource.IsThisParameter() && maybeThisTarget.IsThisParameter() =>
DiagnosticId
.DynamicallyAccessedMembersMismatchThisParameterTargetsThisParameter,
102
(MethodParameterValue maybeThis, MethodParameterValue) when maybeThis.IsThisParameter() =>
DiagnosticId
.DynamicallyAccessedMembersMismatchThisParameterTargetsParameter,
103
(MethodParameterValue maybeThis, MethodReturnValue) when maybeThis.IsThisParameter() =>
DiagnosticId
.DynamicallyAccessedMembersMismatchThisParameterTargetsMethodReturnType,
104
(MethodParameterValue maybeThis, FieldValue) when maybeThis.IsThisParameter() =>
DiagnosticId
.DynamicallyAccessedMembersMismatchThisParameterTargetsField,
105
(MethodParameterValue maybeThis, GenericParameterValue) when maybeThis.IsThisParameter() =>
DiagnosticId
.DynamicallyAccessedMembersMismatchThisParameterTargetsGenericParameter,
106
(MethodParameterValue, MethodParameterValue maybeThis) when maybeThis.IsThisParameter() =>
DiagnosticId
.DynamicallyAccessedMembersMismatchParameterTargetsThisParameter,
107
(MethodParameterValue, MethodParameterValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchParameterTargetsParameter,
108
(MethodParameterValue, MethodReturnValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchParameterTargetsMethodReturnType,
109
(MethodParameterValue, FieldValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchParameterTargetsField,
110
(MethodParameterValue, GenericParameterValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchParameterTargetsGenericParameter,
111
(MethodReturnValue, MethodParameterValue maybeThis) when maybeThis.IsThisParameter() =>
DiagnosticId
.DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsThisParameter,
112
(MethodReturnValue, MethodParameterValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsParameter,
113
(MethodReturnValue, MethodReturnValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsMethodReturnType,
114
(MethodReturnValue, FieldValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsField,
115
(MethodReturnValue, GenericParameterValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchMethodReturnTypeTargetsGenericParameter,
116
(FieldValue, MethodParameterValue maybeThis) when maybeThis.IsThisParameter() =>
DiagnosticId
.DynamicallyAccessedMembersMismatchFieldTargetsThisParameter,
117
(FieldValue, MethodParameterValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchFieldTargetsParameter,
118
(FieldValue, MethodReturnValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchFieldTargetsMethodReturnType,
119
(FieldValue, FieldValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchFieldTargetsField,
120
(FieldValue, GenericParameterValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchFieldTargetsGenericParameter,
121
(GenericParameterValue, MethodParameterValue maybeThis) when maybeThis.IsThisParameter() =>
DiagnosticId
.DynamicallyAccessedMembersMismatchTypeArgumentTargetsThisParameter,
122
(GenericParameterValue, MethodParameterValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchTypeArgumentTargetsParameter,
123
(GenericParameterValue, MethodReturnValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchTypeArgumentTargetsMethodReturnType,
124
(GenericParameterValue, FieldValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchTypeArgumentTargetsField,
125
(GenericParameterValue, GenericParameterValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchTypeArgumentTargetsGenericParameter,
126
(NullableValueWithDynamicallyAccessedMembers, MethodParameterValue maybeThis) when maybeThis.IsThisParameter() =>
DiagnosticId
.DynamicallyAccessedMembersMismatchTypeArgumentTargetsThisParameter,
127
(NullableValueWithDynamicallyAccessedMembers, MethodParameterValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchTypeArgumentTargetsParameter,
128
(NullableValueWithDynamicallyAccessedMembers, MethodReturnValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchTypeArgumentTargetsMethodReturnType,
129
(NullableValueWithDynamicallyAccessedMembers, FieldValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchTypeArgumentTargetsField,
130
(NullableValueWithDynamicallyAccessedMembers, GenericParameterValue) =>
DiagnosticId
.DynamicallyAccessedMembersMismatchTypeArgumentTargetsGenericParameter,
src\tools\illink\src\ILLink.Shared\DiagnosticId.cs (6)
220
public static string AsString(this
DiagnosticId
diagnosticId) => $"IL{(int)diagnosticId}";
222
public static string GetDiagnosticSubcategory(this
DiagnosticId
diagnosticId) =>
237
>= 2109 and < (int)
DiagnosticId
._EndTrimAnalysisWarningsSentinel => MessageSubCategory.TrimAnalysis,
239
>= 3054 and < (int)
DiagnosticId
._EndAotAnalysisWarningsSentinel => MessageSubCategory.AotAnalysis,
243
public static string GetDiagnosticCategory(this
DiagnosticId
diagnosticId) =>
252
public static string? GetHelpUri(this
DiagnosticId
diagnosticId) =>
src\tools\illink\src\ILLink.Shared\DiagnosticString.cs (1)
16
public DiagnosticString(
DiagnosticId
diagnosticId)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\DiagnosticContext.cs (2)
22
public partial void AddDiagnostic(
DiagnosticId
id, params string[] args);
28
public partial void AddDiagnostic(
DiagnosticId
id, ValueWithDynamicallyAccessedMembers actualValue, ValueWithDynamicallyAccessedMembers expectedAnnotationsValue, params string[] args);
src\tools\illink\src\ILLink.Shared\TrimAnalysis\HandleCallAction.cs (13)
380
_diagnosticContext.AddDiagnostic(
DiagnosticId
.UnrecognizedTypeInRuntimeHelpersRunClassConstructor, calledMethod.GetDisplayName());
884
_diagnosticContext.AddDiagnostic(
DiagnosticId
.PropertyAccessorParameterInLinqExpressionsCannotBeStaticallyDetermined,
981
_diagnosticContext.AddDiagnostic(
DiagnosticId
.MakeGenericMethod, calledMethod.GetDisplayName());
994
_diagnosticContext.AddDiagnostic(
DiagnosticId
.MakeGenericMethod, calledMethod.GetDisplayName());
1053
_diagnosticContext.AddDiagnostic(
DiagnosticId
.CaseInsensitiveTypeGetTypeCallIsNotSupported, calledMethod.GetDisplayName());
1085
_diagnosticContext.AddDiagnostic(
DiagnosticId
.UnrecognizedTypeNameInTypeGetType, calledMethod.GetDisplayName());
1165
_diagnosticContext.AddDiagnostic(
DiagnosticId
.MakeGenericType, calledMethod.GetDisplayName());
1177
_diagnosticContext.AddDiagnostic(
DiagnosticId
.MakeGenericType, calledMethod.GetDisplayName());
1364
_diagnosticContext.AddDiagnostic(
DiagnosticId
.MakeGenericMethod, calledMethod.GetDisplayName());
1519
_diagnosticContext.AddDiagnostic(
DiagnosticId
.ParametersOfAssemblyCreateInstanceCannotBeAnalyzed, calledMethod.GetDisplayName());
1657
_diagnosticContext.AddDiagnostic(
DiagnosticId
.MakeGenericMethod, reflectionMethod.GetDisplayName());
1720
_diagnosticContext.AddDiagnostic(
DiagnosticId
.UnrecognizedParameterInMethodCreateInstance, new ParameterProxy(calledMethod, (ParameterIndex)1 + offset).GetDisplayName(), calledMethod.GetDisplayName());
1726
_diagnosticContext.AddDiagnostic(
DiagnosticId
.UnrecognizedParameterInMethodCreateInstance, new ParameterProxy(calledMethod, (ParameterIndex)0 + offset).GetDisplayName(), calledMethod.GetDisplayName());
src\tools\illink\src\ILLink.Shared\TrimAnalysis\RequireDynamicallyAccessedMembersAction.cs (7)
49
(
var
diagnosticId, var diagnosticArguments) = Annotations.GetDiagnosticForAnnotationMismatch(valueWithDynamicallyAccessedMembers, targetValue, missingMemberTypes);
79
DiagnosticId
diagnosticId = targetValue switch
81
MethodParameterValue maybeThis when maybeThis.IsThisParameter() =>
DiagnosticId
.ImplicitThisCannotBeStaticallyDetermined,
82
MethodParameterValue =>
DiagnosticId
.MethodParameterCannotBeStaticallyDetermined,
83
MethodReturnValue =>
DiagnosticId
.MethodReturnValueCannotBeStaticallyDetermined,
84
FieldValue =>
DiagnosticId
.FieldValueCannotBeStaticallyDetermined,
85
GenericParameterValue =>
DiagnosticId
.TypePassedToGenericParameterCannotBeStaticallyDetermined,