Skip to content

Commit 12885df

Browse files
authored
Fix new warning which shows up with latest roslyn (#3179)
First encountered in dotnet/runtime#80235, so copying the change to dotnet/linker
1 parent 4b3f78c commit 12885df

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ILLink.Tasks/CreateRuntimeRootDescriptorFile.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ readonly struct FeatureSwitchMembers
6868
public string FeatureValue { get; }
6969
public string FeatureDefault { get; }
7070
// Unique value to track the key
71-
private readonly String _key;
71+
private readonly string _key;
7272

7373
public FeatureSwitchMembers (string feature, string featureValue, string featureDefault)
7474
{
@@ -302,7 +302,7 @@ void OutputXml (string iLLinkTrimXmlFilePath, string outputFileName)
302302
{
303303
XmlDocument doc = new XmlDocument ();
304304
doc.Load (iLLinkTrimXmlFilePath);
305-
XmlNode linkerNode = doc["linker"];
305+
XmlElement linkerNode = doc["linker"];
306306

307307
if (featureSwitchMembers.Count > 0) {
308308
foreach ((var fs, var members) in featureSwitchMembers.Select (kv => (kv.Key, kv.Value))) {
@@ -344,7 +344,7 @@ void OutputXml (string iLLinkTrimXmlFilePath, string outputFileName)
344344

345345
static void AddXmlTypeNode (XmlDocument doc, XmlNode assemblyNode, string typeName, ClassMembers members)
346346
{
347-
XmlNode typeNode = doc.CreateElement ("type");
347+
XmlElement typeNode = doc.CreateElement ("type");
348348
XmlAttribute typeFullName = doc.CreateAttribute ("fullname");
349349
typeFullName.Value = typeName;
350350
typeNode.Attributes.Append (typeFullName);

src/linker/Linker/LinkerAttributesInformation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public IEnumerable<T> GetAttributes<T> () where T : Attribute
106106
return attributeList.Cast<T> ();
107107
}
108108

109-
static Attribute? ProcessRequiresUnreferencedCodeAttribute (LinkContext context, ICustomAttributeProvider provider, CustomAttribute customAttribute)
109+
static RequiresUnreferencedCodeAttribute? ProcessRequiresUnreferencedCodeAttribute (LinkContext context, ICustomAttributeProvider provider, CustomAttribute customAttribute)
110110
{
111111
if (!(provider is MethodDefinition || provider is TypeDefinition))
112112
return null;

0 commit comments

Comments
 (0)