diff options
author | Sven Boemer <sbomer@gmail.com> | 2021-07-30 02:38:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 02:38:03 +0300 |
commit | aec70d0ae5a5d304176bb9831f5ffdb6e13d3568 (patch) | |
tree | 77702bf72b15089814a14aab67b1c37096a5b208 /test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs | |
parent | c1d83c9ca5953f7e09812a48e2bddf90efbea0c5 (diff) |
Fix warning origin for DAM on types (#2162)
* Fix warning origin for DAM on types
* Update tests with link to suppression issue
Messages for these warnings can not be suppressed at the member level
due to issues described in https://github.com/mono/linker/issues/2163.
Also fix expected warnings for properties, revert ResultChecker changes,
and remove redundant test.
* PR feedback
- Include "Attribute" in attribute type names
- Add comments about why we want to report warnings
- Add comment about the interaction with RUC on types
* Add testcase for nested type with default ctor
* PR feedback
- Clean up some test attributes
- Add test with DAM field on annotated PublicMethods type
- Add link to issue about duplicate warnings
Also use replace DAMT with DAM in tests.
* Use member-level suppressions in tests
* Unify with behavior for DAM warnings
- Don't warn on non-virtual methods that don't have return annotations
- Use the helpers introduced in https://github.com/mono/linker/pull/2145
* PR feedback
Clarify that getter without annotated return value doesn't warn because
it's non-virtual
Diffstat (limited to 'test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs')
-rw-r--r-- | test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs b/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs index 7c71f3270..e03e732f8 100644 --- a/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs +++ b/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; using System.Text.RegularExpressions; using Mono.Cecil; @@ -761,6 +762,9 @@ namespace Mono.Linker.Tests.TestCasesRunner if (actualName.StartsWith (attrProvider.DeclaringType.FullName) && actualName.Contains ("<" + attrProvider.Name + ">")) return true; + if (methodDefinition.Name == ".ctor" && + methodDefinition.DeclaringType.FullName == attrProvider.FullName) + return true; } return false; |