예제 #1
0
        public static void Main()
        {
            var suppressWarningsInType = new SuppressWarningsInType();

            suppressWarningsInType.Warning1();
            suppressWarningsInType.Warning2();
            var nestedType = new SuppressWarningsInType.NestedType();

            nestedType.Warning3();

            var suppressWarningsInMembers = new SuppressWarningsInMembers();

            suppressWarningsInMembers.Method();
            suppressWarningsInMembers.SuppressionHasNullParameters();
            int propertyThatTriggersWarning = suppressWarningsInMembers.Property;

            NestedType.Warning();
        }
예제 #2
0
        /// <summary>
        /// This test case checks module level UnconditionalSuppressMessage, primarily using
        /// System.Linq.Expressions.Expression.(Type type, string methodName, Type[]? typeArguments, params System.Linq.Expressions.Expression[]? arguments)
        /// which has a RUC attribute but is treated as an intrinsic by the trimmer. The test case also has some member level suppressions and its
        /// own RUC method (the IL2026 suppression in the code is due to this)
        /// </summary>
        public static void Main()
        {
            NestedType.Warning();
            var warningsInType = new WarningsInType();

            warningsInType.Warning1();
            var warningInNestedType = new WarningsInType.NestedType();

            warningInNestedType.Warning3();

            var warningsInMembers = new WarningsInMembers();

            warningsInMembers.Method();
            int propertyThatTriggersWarning = warningsInMembers.Property;

            WarningsInMembers.MultipleWarnings();
            WarningsInMembers.MultipleSuppressions();
        }