-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove ILLink warnings from empty console app (#45808)
* Remove ILLink warnings from empty console app Also clean up some previously addressed warnings in the suppressions xml file. Contributes to #45623 * Add trimming test for inherited attributes.
- Loading branch information
Showing
13 changed files
with
65 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Suppressions.Shared.NonWindows.xml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/libraries/System.Runtime/tests/TrimmingTests/InheritedAttributeTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
|
||
[AttributeUsage(AttributeTargets.Property, Inherited = true)] | ||
class FooAttribute : Attribute{ } | ||
[AttributeUsage(AttributeTargets.Property, Inherited = true)] | ||
class BarAttribute : Attribute { } | ||
[AttributeUsage(AttributeTargets.Property, Inherited = true)] | ||
class BazAttribute : Attribute { } | ||
|
||
class Base | ||
{ | ||
[Foo] | ||
public virtual int X { get; } | ||
} | ||
|
||
class Mid : Base | ||
{ | ||
[Bar] | ||
public override int X => base.X; | ||
} | ||
|
||
class Derived : Mid | ||
{ | ||
[Baz] | ||
public override int X => base.X; | ||
} | ||
|
||
class Program | ||
{ | ||
static int Main(string[] args) | ||
{ | ||
int numAttributes = Attribute.GetCustomAttributes(typeof(Derived).GetProperty("X"), inherit: true).Length; | ||
if (numAttributes == 3) | ||
{ | ||
return 100; | ||
} | ||
|
||
return -1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters