@@ -23,29 +23,67 @@ class RequiresAttributeMismatch
2323 {
2424 // Base/Derived and Implementation/Interface differs between ILLink and analyzer https://github.com/dotnet/linker/issues/2533
2525 [ ExpectedWarning ( "IL2026" , "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get" ) ]
26+ [ ExpectedWarning ( "IL3002" , "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
27+ [ ExpectedWarning ( "IL3050" , "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
2628 [ ExpectedWarning ( "IL2026" , "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get" ) ]
29+ [ ExpectedWarning ( "IL3002" , "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
30+ [ ExpectedWarning ( "IL3050" , "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
2731 [ ExpectedWarning ( "IL2026" , "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get" ) ]
32+ [ ExpectedWarning ( "IL3002" , "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
33+ [ ExpectedWarning ( "IL3050" , "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
2834 [ ExpectedWarning ( "IL2026" , "DerivedClassWithRequires.VirtualPropertyAnnotationInAccesor.get" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
35+ [ ExpectedWarning ( "IL3002" , "DerivedClassWithRequires.VirtualPropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
36+ [ ExpectedWarning ( "IL3050" , "DerivedClassWithRequires.VirtualPropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
2937 [ ExpectedWarning ( "IL2026" , "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInAccesor.set" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
38+ [ ExpectedWarning ( "IL3002" , "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInAccesor.set" , ProducedBy = Tool . NativeAot ) ]
3039 [ ExpectedWarning ( "IL2026" , "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInProperty.get" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
40+ [ ExpectedWarning ( "IL3002" , "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInProperty.get" , ProducedBy = Tool . NativeAot ) ]
3141 [ ExpectedWarning ( "IL2026" , "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInProperty.set" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
42+ [ ExpectedWarning ( "IL3002" , "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInProperty.set" , ProducedBy = Tool . NativeAot ) ]
43+ [ ExpectedWarning ( "IL2026" , "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInPropertyAndAccessor.set" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
44+ [ ExpectedWarning ( "IL3002" , "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInPropertyAndAccessor.set" , ProducedBy = Tool . NativeAot ) ]
3245 [ ExpectedWarning ( "IL2026" , "BaseClassWithRequires.VirtualMethod()" ) ]
46+ [ ExpectedWarning ( "IL3002" , "BaseClassWithRequires.VirtualMethod()" , ProducedBy = Tool . NativeAot ) ]
47+ [ ExpectedWarning ( "IL3050" , "BaseClassWithRequires.VirtualMethod()" , ProducedBy = Tool . NativeAot ) ]
3348 [ ExpectedWarning ( "IL2026" , "BaseClassWithRequires.VirtualMethod()" ) ]
49+ [ ExpectedWarning ( "IL3002" , "BaseClassWithRequires.VirtualMethod()" , ProducedBy = Tool . NativeAot ) ]
50+ [ ExpectedWarning ( "IL3050" , "BaseClassWithRequires.VirtualMethod()" , ProducedBy = Tool . NativeAot ) ]
3451 [ ExpectedWarning ( "IL2026" , "BaseClassWithRequires.VirtualMethod()" ) ]
52+ [ ExpectedWarning ( "IL3002" , "BaseClassWithRequires.VirtualMethod()" , ProducedBy = Tool . NativeAot ) ]
53+ [ ExpectedWarning ( "IL3050" , "BaseClassWithRequires.VirtualMethod()" , ProducedBy = Tool . NativeAot ) ]
3554 [ ExpectedWarning ( "IL2026" , "DerivedClassWithRequires.VirtualMethod()" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
55+ [ ExpectedWarning ( "IL3002" , "DerivedClassWithRequires.VirtualMethod()" , ProducedBy = Tool . NativeAot ) ]
56+ [ ExpectedWarning ( "IL3050" , "DerivedClassWithRequires.VirtualMethod()" , ProducedBy = Tool . NativeAot ) ]
3657 [ ExpectedWarning ( "IL2026" , "IBaseWithRequires.PropertyAnnotationInAccesor.get" ) ]
37- [ ExpectedWarning ( "IL2026" , "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor.set" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
58+ [ ExpectedWarning ( "IL3002" , "IBaseWithRequires.PropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
59+ [ ExpectedWarning ( "IL3050" , "IBaseWithRequires.PropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
60+ [ ExpectedWarning ( "IL2026" , "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor.set" ) ]
61+ [ ExpectedWarning ( "IL3002" , "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor.set" , ProducedBy = Tool . NativeAot ) ]
3862 [ ExpectedWarning ( "IL2026" , "IBaseWithRequires.Method()" ) ]
63+ [ ExpectedWarning ( "IL3002" , "IBaseWithRequires.Method()" , ProducedBy = Tool . NativeAot ) ]
64+ [ ExpectedWarning ( "IL3050" , "IBaseWithRequires.Method()" , ProducedBy = Tool . NativeAot ) ]
3965 [ ExpectedWarning ( "IL2026" , "ImplementationClassWithRequires.Method()" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
66+ [ ExpectedWarning ( "IL3002" , "ImplementationClassWithRequires.Method()" , ProducedBy = Tool . NativeAot ) ]
67+ [ ExpectedWarning ( "IL3050" , "ImplementationClassWithRequires.Method()" , ProducedBy = Tool . NativeAot ) ]
4068 [ ExpectedWarning ( "IL2026" , "ImplementationClassWithRequires.PropertyAnnotationInAccesor.get" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
69+ [ ExpectedWarning ( "IL3002" , "ImplementationClassWithRequires.PropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
70+ [ ExpectedWarning ( "IL3050" , "ImplementationClassWithRequires.PropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
4171 [ ExpectedWarning ( "IL2026" , "ImplementationClassWithRequires.PropertyAnnotationInPropertyAndAccessor.get" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
72+ [ ExpectedWarning ( "IL3002" , "ImplementationClassWithRequires.PropertyAnnotationInPropertyAndAccessor.get" , ProducedBy = Tool . NativeAot ) ]
4273 [ ExpectedWarning ( "IL2026" , "ImplementationClassWithoutRequires.PropertyAnnotationInPropertyAndAccessor.get" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
74+ [ ExpectedWarning ( "IL3002" , "ImplementationClassWithoutRequires.PropertyAnnotationInPropertyAndAccessor.get" , ProducedBy = Tool . NativeAot ) ]
4375 [ ExpectedWarning ( "IL2026" , "ImplementationClassWithRequiresInSource.Method()" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
76+ [ ExpectedWarning ( "IL3002" , "ImplementationClassWithRequiresInSource.Method()" , ProducedBy = Tool . NativeAot ) ]
77+ [ ExpectedWarning ( "IL3050" , "ImplementationClassWithRequiresInSource.Method()" , ProducedBy = Tool . NativeAot ) ]
4478 [ ExpectedWarning ( "IL2026" , "ImplementationClassWithRequiresInSource.PropertyAnnotationInAccesor.get" , ProducedBy = Tool . Analyzer | Tool . NativeAot ) ]
79+ [ ExpectedWarning ( "IL3002" , "ImplementationClassWithRequiresInSource.PropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
80+ [ ExpectedWarning ( "IL3050" , "ImplementationClassWithRequiresInSource.PropertyAnnotationInAccesor.get" , ProducedBy = Tool . NativeAot ) ]
4581 [ ExpectedWarning ( "IL2026" , "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get" ) ]
82+ [ ExpectedWarning ( "IL3002" , "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get" , ProducedBy = Tool . NativeAot ) ]
4683 [ ExpectedWarning ( "IL2026" , "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get" ) ]
84+ [ ExpectedWarning ( "IL3002" , "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get" , ProducedBy = Tool . NativeAot ) ]
4785 [ ExpectedWarning ( "IL2026" , "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get" ) ]
48- [ ExpectedWarning ( "IL2026 " , "PropertyAnnotationInPropertyAndAccessor.set" ) ]
86+ [ ExpectedWarning ( "IL3002 " , "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get" , ProducedBy = Tool . NativeAot ) ]
4987
5088 public static void Main ( )
5189 {
@@ -492,11 +530,23 @@ public string PropertyAnnotationInAccesor {
492530 class StaticInterfaceMethods
493531 {
494532 [ ExpectedWarning ( "IL2026" ) ]
533+ [ ExpectedWarning ( "IL3002" , ProducedBy = Tool . NativeAot ) ]
534+ [ ExpectedWarning ( "IL3050" , ProducedBy = Tool . NativeAot ) ]
495535 [ ExpectedWarning ( "IL2026" ) ]
536+ [ ExpectedWarning ( "IL3002" , ProducedBy = Tool . NativeAot ) ]
537+ [ ExpectedWarning ( "IL3050" , ProducedBy = Tool . NativeAot ) ]
496538 [ ExpectedWarning ( "IL2026" ) ]
539+ [ ExpectedWarning ( "IL3002" , ProducedBy = Tool . NativeAot ) ]
540+ [ ExpectedWarning ( "IL3050" , ProducedBy = Tool . NativeAot ) ]
497541 [ ExpectedWarning ( "IL2026" ) ]
542+ [ ExpectedWarning ( "IL3002" , ProducedBy = Tool . NativeAot ) ]
543+ [ ExpectedWarning ( "IL3050" , ProducedBy = Tool . NativeAot ) ]
498544 [ ExpectedWarning ( "IL2026" ) ]
545+ [ ExpectedWarning ( "IL3002" , ProducedBy = Tool . NativeAot ) ]
546+ [ ExpectedWarning ( "IL3050" , ProducedBy = Tool . NativeAot ) ]
499547 [ ExpectedWarning ( "IL2026" ) ]
548+ [ ExpectedWarning ( "IL3002" , ProducedBy = Tool . NativeAot ) ]
549+ [ ExpectedWarning ( "IL3050" , ProducedBy = Tool . NativeAot ) ]
500550 public static void Test ( )
501551 {
502552 typeof ( IRequires ) . RequiresPublicMethods ( ) ;
@@ -506,6 +556,7 @@ public static void Test ()
506556 typeof ( ImplIRequiresMismatching ) . RequiresPublicMethods ( ) ;
507557 typeof ( ImplIRequiresMatching ) . RequiresPublicMethods ( ) ;
508558 }
559+
509560 interface IRequires
510561 {
511562 [ RequiresUnreferencedCode ( "Message for --StaticInterfaceMethods.IRequires.VirtualMethod--" ) ]
0 commit comments