diff options
author | Sven Boemer <sbomer@gmail.com> | 2022-02-01 21:34:30 +0300 |
---|---|---|
committer | Sven Boemer <sbomer@gmail.com> | 2022-02-01 21:34:30 +0300 |
commit | d9f7347856fa589d879c28722f16a1456599caf8 (patch) | |
tree | f836be6750b354a89ec1a478b76894b79f7a1a8d /test/Mono.Linker.Tests.Cases | |
parent | 03df989da8b03a6030878045ead9962c79bf1075 (diff) |
Fix generic parameter validation
- Don't check type info of method calls, which can give back the return type of the method
- Don't expect trimmer-only warnings in for locals, declaring types
- Fix testcase for differences in generic reporting:
https://github.com/dotnet/linker/issues/2573
Diffstat (limited to 'test/Mono.Linker.Tests.Cases')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs index 060c7eeb7..fb31e7800 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlow.cs @@ -766,7 +766,9 @@ namespace Mono.Linker.Tests.Cases.DataFlow // Warn about calls to the static methods and the ctor on the RUC type: [ExpectedWarning ("IL2026", "RUCTypeRequiresPublicFields<T>.StaticMethod", "message")] - [ExpectedWarning ("IL2026", "RUCTypeRequiresPublicFields<T>.StaticMethodRequiresPublicMethods<U>", "message")] + [ExpectedWarning ("IL2026", "RUCTypeRequiresPublicFields<T>.StaticMethodRequiresPublicMethods<U>", "message", ProducedBy = ProducedBy.Trimmer)] + // https://github.com/dotnet/linker/issues/2573 + [ExpectedWarning ("IL2026", "RUCTypeRequiresPublicFields<T>.StaticMethodRequiresPublicMethods<T>", "message", ProducedBy = ProducedBy.Analyzer)] [ExpectedWarning ("IL2026", "RUCTypeRequiresPublicFields<T>.RUCTypeRequiresPublicFields", "message")] // And about method generic parameters: [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>.InstanceMethodRequiresPublicMethods<U>()")] @@ -775,12 +777,12 @@ namespace Mono.Linker.Tests.Cases.DataFlow // And about type generic parameters: (one for each reference to the type): [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>")] // StaticMethod [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>")] // StaticMethodRequiresPublicMethods<T> - [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>")] // RUCTypeRequiresPublicFields<T> local [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>")] // RUCTypeRequiresPublicFields<T> ctor - [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>")] // InstanceMethod - [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>")] // InstanceMethodRequiresPublicMethods<T> - [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>")] // VirtualMethod - [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>")] // VirtualMethodRequiresPublicMethods<T> + [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>", ProducedBy = ProducedBy.Trimmer)] // RUCTypeRequiresPublicFields<T> local + [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>", ProducedBy = ProducedBy.Trimmer)] // InstanceMethod + [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>", ProducedBy = ProducedBy.Trimmer)] // InstanceMethodRequiresPublicMethods<T> + [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>", ProducedBy = ProducedBy.Trimmer)] // VirtualMethod + [ExpectedWarning ("IL2091", "RUCTypeRequiresPublicFields<T>", ProducedBy = ProducedBy.Trimmer)] // VirtualMethodRequiresPublicMethods<T> static void TestNoWarningsInRUCType<T> () { RUCTypeRequiresPublicFields<T>.StaticMethod (); |