Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ILLink: Don't mark attributes from MarkEntireType #108552

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/tools/illink/src/linker/Linker.Steps/MarkStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,6 @@ internal void MarkEntireType (TypeDefinition type, in DependencyInfo reason, Mes
}

MarkTypeVisibleToReflection (type, reason, origin);
MarkCustomAttributes (type, new DependencyInfo (DependencyKind.CustomAttribute, type), origin);
MarkTypeSpecialCustomAttributes (type, origin);

if (type.HasInterfaces) {
foreach (InterfaceImplementation iface in type.Interfaces)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
Expand All @@ -8,6 +8,7 @@

namespace Mono.Linker.Tests.Cases.RequiresCapability
{
[IgnoreTestCase ("NativeAOT test infrastructure doesn't implement rooting behavior the same way", IgnoredBy = Tool.NativeAot)]
[SetupLinkerArgument ("-a", "test.exe", "all")]

[SkipKeptItemsValidation]
Expand Down Expand Up @@ -55,5 +56,16 @@ public void InstanceMethod () { }

public static event EventHandler PropertyChanged;
}

[AttributeWithRequires]
[ExpectedWarning ("IL2026")]
public sealed class ClassWithAttributeWithRequires
{
}

[RequiresUnreferencedCode ("--AttributeWithRequiresAttribute--")]
public sealed class AttributeWithRequiresAttribute : Attribute
{
}
}
}
Loading