238 references to DiagnosticId
illink (238)
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());
319
AddWarning(new MessageOrigin(userDefinedMethod),
DiagnosticId
.MethodsAreAssociatedWithUserMethod, userDefinedMethod.GetDisplayName(), alreadyAssociatedMethod.GetDisplayName(), nestedFunction.GetDisplayName());
349
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 (16)
228
_context.LogWarning(member,
DiagnosticId
.AttributeDoesntHaveTheRequiredNumberOfParameters, "System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute");
254
_context.LogWarning(field,
DiagnosticId
.DynamicallyAccessedMembersOnFieldCanOnlyApplyToTypesOrStrings, field.GetDisplayName());
275
_context.LogWarning(method,
DiagnosticId
.DynamicallyAccessedMembersIsNotAllowedOnMethods);
287
_context.LogWarning(method,
DiagnosticId
.DynamicallyAccessedMembersIsNotAllowedOnMethods);
289
_context.LogWarning(method,
DiagnosticId
.DynamicallyAccessedMembersOnMethodParameterCanOnlyApplyToTypesOrStrings,
301
_context.LogWarning(method,
DiagnosticId
.DynamicallyAccessedMembersOnMethodReturnValueCanOnlyApplyToTypesOrStrings, method.GetDisplayName());
350
_context.LogWarning(property,
DiagnosticId
.DynamicallyAccessedMembersOnPropertyCanOnlyApplyToTypesOrStrings, property.GetDisplayName());
381
_context.LogWarning(setMethod,
DiagnosticId
.DynamicallyAccessedMembersConflictsBetweenPropertyAndAccessor, property.GetDisplayName(), setMethod.GetDisplayName());
425
_context.LogWarning(getMethod,
DiagnosticId
.DynamicallyAccessedMembersConflictsBetweenPropertyAndAccessor, property.GetDisplayName(), getMethod.GetDisplayName());
448
_context.LogWarning(property,
DiagnosticId
.DynamicallyAccessedMembersCouldNotFindBackingField, property.GetDisplayName());
454
_context.LogWarning(property,
DiagnosticId
.DynamicallyAccessedMembersCouldNotFindBackingField, property.GetDisplayName());
465
_context.LogWarning(backingField,
DiagnosticId
.DynamicallyAccessedMembersOnPropertyConflictsWithBackingField, property.GetDisplayName(), backingField.GetDisplayName());
676
_context.LogWarning(origin,
DiagnosticId
.DynamicallyAccessedMembersMismatchOnMethodParameterBetweenOverrides,
681
_context.LogWarning(origin,
DiagnosticId
.DynamicallyAccessedMembersMismatchOnMethodReturnValueBetweenOverrides,
686
_context.LogWarning(origin,
DiagnosticId
.DynamicallyAccessedMembersMismatchOnImplicitThisBetweenOverrides,
691
_context.LogWarning(origin,
DiagnosticId
.DynamicallyAccessedMembersMismatchOnGenericParameterBetweenOverrides,
Linker.Dataflow\HandleCallAction.cs (3)
63
_diagnosticContext.AddDiagnostic(
DiagnosticId
.CorrectnessOfCOMCannotBeGuaranteed, calledMethod.GetDisplayName());
204
_diagnosticContext.AddDiagnostic(
DiagnosticId
.TypeMapGroupTypeCannotBeStaticallyDetermined, method.GenericArguments[0].FullName);
286
_diagnosticContext.AddDiagnostic(
DiagnosticId
.UnresolvedAssemblyInCreateInstance,
Linker.Dataflow\MethodBodyScanner.cs (2)
206
(int)
DiagnosticId
.LinkerUnexpectedError,
964
(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 (30)
936
Context.LogWarning(origin,
DiagnosticId
.UnresolvedAssemblyInDynamicDependencyAttribute, dynamicDependency.AssemblyName);
952
Context.LogWarning(origin,
DiagnosticId
.UnresolvedTypeInDynamicDependencyAttribute, typeName);
963
Context.LogWarning(origin,
DiagnosticId
.UnresolvedTypeInDynamicDependencyAttribute, typeReference.GetDisplayName());
972
Context.LogWarning(context,
DiagnosticId
.UnresolvedTypeInDynamicDependencyAttribute, context.DeclaringType.GetDisplayName());
983
Context.LogWarning(origin,
DiagnosticId
.NoMembersResolvedForMemberSignatureOrType, memberSignature, type.GetDisplayName());
993
Context.LogWarning(origin,
DiagnosticId
.NoMembersResolvedForMemberSignatureOrType, memberTypes.ToString(), type.GetDisplayName());
1036
Context.LogWarning(context,
DiagnosticId
.DeprecatedPreserveDependencyAttribute);
1048
Context.LogWarning(context,
DiagnosticId
.CouldNotResolveDependencyAssembly, assemblyName);
1065
Context.LogWarning(context,
DiagnosticId
.CouldNotResolveDependencyType, typeName);
1110
Context.LogWarning(context,
DiagnosticId
.CouldNotResolveDependencyMember, member ?? "", td.GetDisplayName());
1776
Context.LogWarning(origin,
DiagnosticId
.DynamicallyAccessedMembersMethodAccessedViaReflection, method.GetDisplayName());
1812
var
id = reportOnMember ?
DiagnosticId
.DynamicallyAccessedMembersOnTypeReferencesMemberWithRequiresUnreferencedCode :
DiagnosticId
.DynamicallyAccessedMembersOnTypeReferencesMemberOnBaseWithRequiresUnreferencedCode;
1822
var
id = reportOnMember ?
DiagnosticId
.DynamicallyAccessedMembersOnTypeReferencesMemberWithDynamicallyAccessedMembers :
DiagnosticId
.DynamicallyAccessedMembersOnTypeReferencesMemberOnBaseWithDynamicallyAccessedMembers;
1924
Context.LogWarning(origin,
DiagnosticId
.DynamicallyAccessedMembersFieldAccessedViaReflection, field.GetDisplayName());
2145
Context.LogWarning(origin,
DiagnosticId
.AttributeIsReferencedButTrimmerRemoveAllInstances, type.GetDisplayName());
2975
Context.LogWarning(type,
DiagnosticId
.TypeHasNoFieldsToPreserve, type.GetDisplayName());
2979
Context.LogWarning(type,
DiagnosticId
.TypeHasNoMethodsToPreserve, type.GetDisplayName());
3321
diagnosticContext.AddDiagnostic(
DiagnosticId
.RequiresUnreferencedCode, displayName, arg1, arg2);
3370
Context.LogWarning(methodOrigin,
DiagnosticId
.RequiresUnreferencedCodeOnStaticConstructor, method.GetDisplayName());
3372
Context.LogWarning(methodOrigin,
DiagnosticId
.RequiresUnreferencedCodeOnEntryPoint, method.GetDisplayName());
3574
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(origin,
DiagnosticId
.CannotStubConstructorWhenBaseTypeDoesNotHaveConstructor, method.DeclaringType.GetDisplayName()));
3591
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(null,
DiagnosticId
.CouldNotFindType, "System.NotSupportedException"));
3597
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(null,
DiagnosticId
.CouldNotFindConstructor, nse.GetDisplayName()));
3607
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(null,
DiagnosticId
.CouldNotFindConstructor, objectType.GetDisplayName()));
3617
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(null,
DiagnosticId
.CouldNotFindType, "System.Runtime.CompilerServices.DisablePrivateReflectionAttribute"));
3624
throw new LinkerFatalErrorException(MessageContainer.CreateErrorMessage(null,
DiagnosticId
.CouldNotFindConstructor, disablePrivateReflection.GetDisplayName()));
Linker.Steps\OutputStep.cs (1)
115
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());
117
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);
586
context.LogError(null,
DiagnosticId
.InvalidGenerateWarningSuppressionsValue, generateWarningSuppressionsArgument);
656
context.LogError(null,
DiagnosticId
.InvalidAssemblyName, assemblyName);
678
context.LogError(null,
DiagnosticId
.InvalidAssemblyName, assemblyName);
737
context.LogError(null,
DiagnosticId
.XmlDescriptorCouldNotBeFound, xmlFile);
751
context.LogError(null,
DiagnosticId
.RootAssemblyCouldNotBeFound, assemblyFile);
800
context.LogError(null,
DiagnosticId
.UnrecognizedCommandLineOption, token);
806
context.LogError(null,
DiagnosticId
.NoFilesToLinkSpecified, resolvers);
812
context.LogError(null,
DiagnosticId
.NewMvidAndDeterministicCannotBeUsedAtSameTime);
834
context.LogError(null,
DiagnosticId
.InvalidDependenciesFileFormat);
960
Context.LogError(null,
DiagnosticId
.FailedToResolveMetadataElement, re.Message);
963
Context.LogError(null,
DiagnosticId
.LinkerUnexpectedError);
1008
Context.LogError(null,
DiagnosticId
.AssemblyInCustomStepOptionCouldNotBeFound, arg);
1011
Context.LogError(null,
DiagnosticId
.AssemblyPathInCustomStepMustBeFullyQualified, arg);
1086
Context.LogError(null,
DiagnosticId
.InvalidArgForCustomStep, arg);
1093
Context.LogError(null,
DiagnosticId
.ExpectedSignToControlNewStepInsertion);
1118
Context.LogError(null,
DiagnosticId
.PipelineStepCouldNotBeFound, targetName);
1143
Context.LogError(null,
DiagnosticId
.PipelineStepCouldNotBeFound, targetName);
1155
Context.LogError(null,
DiagnosticId
.CustomStepTypeIsIncompatibleWithLinkerVersion, stepType.ToString());
1192
Context.LogError(null,
DiagnosticId
.CustomStepTypeCouldNotBeFound, type);
1208
Context.LogError(null,
DiagnosticId
.CustomStepTypeCouldNotBeFound, type);
1214
Context.LogError(null,
DiagnosticId
.CustomStepTypeIsIncompatibleWithLinkerVersion, type);
1263
Context.LogError(null,
DiagnosticId
.InvalidAssemblyAction, s);
1281
Context.LogError(null,
DiagnosticId
.InvalidAssemblyRootMode, s);
1294
Context.LogError(null,
DiagnosticId
.InvalidWarningVersion, text);
1329
Context.LogError(null,
DiagnosticId
.InvalidOptimizationValue, text);
1349
Context.LogError(null,
DiagnosticId
.InvalidMetadataOption, text);
1394
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)
464
LogWarning(GetAssemblyLocation(assembly),
DiagnosticId
.InvalidIsTrimmableValue, args[1].Value.ToString() ?? "", assembly.Name.Name);
616
public void LogWarning(MessageOrigin origin,
DiagnosticId
id, params string[] args)
646
internal void LogWarning(IMemberDefinition origin,
DiagnosticId
id, int ilOffset = MessageOrigin.UnsetILOffset, params string[] args)
660
public void LogWarning(IMemberDefinition origin,
DiagnosticId
id, params string[] args)
689
public void LogWarning(string origin,
DiagnosticId
id, params string[] args)
714
public void LogError(MessageOrigin? origin,
DiagnosticId
id, params string[] args)
1045
LogError(string.Format(SharedStrings.FailedToResolveFieldElementMessage, fieldReference.FullName), (int)
DiagnosticId
.FailedToResolveMetadataElement);
1051
LogError(string.Format(SharedStrings.FailedToResolveMethodElementMessage, methodReference.GetDisplayName()), (int)
DiagnosticId
.FailedToResolveMetadataElement);
1057
LogError(string.Format(SharedStrings.FailedToResolveTypeElementMessage, typeReference.GetDisplayName()), (int)
DiagnosticId
.FailedToResolveMetadataElement);
1063
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);
147
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)
223
public static string AsString(this
DiagnosticId
diagnosticId) => $"IL{(int)diagnosticId}";
225
public static string GetDiagnosticSubcategory(this
DiagnosticId
diagnosticId) =>
240
>= 2109 and < (int)
DiagnosticId
._EndTrimAnalysisWarningsSentinel => MessageSubCategory.TrimAnalysis,
242
>= 3054 and < (int)
DiagnosticId
._EndAotAnalysisWarningsSentinel => MessageSubCategory.AotAnalysis,
246
public static string GetDiagnosticCategory(this
DiagnosticId
diagnosticId) =>
255
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());
885
_diagnosticContext.AddDiagnostic(
DiagnosticId
.PropertyAccessorParameterInLinqExpressionsCannotBeStaticallyDetermined,
982
_diagnosticContext.AddDiagnostic(
DiagnosticId
.MakeGenericMethod, calledMethod.GetDisplayName());
995
_diagnosticContext.AddDiagnostic(
DiagnosticId
.MakeGenericMethod, calledMethod.GetDisplayName());
1054
_diagnosticContext.AddDiagnostic(
DiagnosticId
.CaseInsensitiveTypeGetTypeCallIsNotSupported, calledMethod.GetDisplayName());
1086
_diagnosticContext.AddDiagnostic(
DiagnosticId
.UnrecognizedTypeNameInTypeGetType, calledMethod.GetDisplayName());
1166
_diagnosticContext.AddDiagnostic(
DiagnosticId
.MakeGenericType, calledMethod.GetDisplayName());
1178
_diagnosticContext.AddDiagnostic(
DiagnosticId
.MakeGenericType, calledMethod.GetDisplayName());
1365
_diagnosticContext.AddDiagnostic(
DiagnosticId
.MakeGenericMethod, calledMethod.GetDisplayName());
1520
_diagnosticContext.AddDiagnostic(
DiagnosticId
.ParametersOfAssemblyCreateInstanceCannotBeAnalyzed, calledMethod.GetDisplayName());
1658
_diagnosticContext.AddDiagnostic(
DiagnosticId
.MakeGenericMethod, reflectionMethod.GetDisplayName());
1721
_diagnosticContext.AddDiagnostic(
DiagnosticId
.UnrecognizedParameterInMethodCreateInstance, new ParameterProxy(calledMethod, (ParameterIndex)1 + offset).GetDisplayName(), calledMethod.GetDisplayName());
1727
_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,