Example #1
0
        public void Issue1898(int i)
        {
            DisplayClass displayClass = new DisplayClass {
                thisField = this,
                field1    = i
            };
            NestedDisplayClass nested = new NestedDisplayClass();

            while (true)
            {
                switch (Rand())
                {
                case 1:
                    nested.field1 = Rand();
                    break;

                case 2:
                    nested.field2 = Rand().ToString();
                    break;

                case 3:
                    nested.field3 = displayClass;
                    break;

                default:
                    Console.WriteLine(nested.field1);
                    Console.WriteLine(nested.field2);
                    Console.WriteLine(nested.field3);
                    break;
                }
            }
        }
        public void Issue1898(int i)
        {
            DisplayClass displayClass = new DisplayClass {
                thisField = this,
                field1    = i
            };
            int          field1 = default(int);
            string       field2 = default(string);
            DisplayClass field3 = default(DisplayClass);

            while (true)
            {
                switch (Rand())
                {
                case 1:
                    field1 = Rand();
                    continue;

                case 2:
                    field2 = Rand().ToString();
                    continue;

                case 3:
                    field3 = displayClass;
                    continue;
                }
                Console.WriteLine(field1);
                Console.WriteLine(field2);
                Console.WriteLine(field3);
            }
        }
Example #3
0
        public void Test3()
        {
            DisplayClass displayClass = new DisplayClass {
                field1 = 42,
                field2 = "Hello World!"
            };

            Console.WriteLine("{0} {1}", displayClass.field1, displayClass);
        }
Example #4
0
        public void Test7(int i)
        {
            DisplayClass displayClass = new DisplayClass {
                field1 = i,
                field2 = "Hello World!"
            };

            Console.WriteLine("{0} {1} {2}", displayClass.field1++, displayClass.field2, i);
        }
Example #5
0
        public void Test8(int i)
        {
            DisplayClass displayClass = new DisplayClass {
                field1 = i,
                field2 = "Hello World!"
            };

            i = 42;
            Console.WriteLine("{0} {1}", displayClass.field1, displayClass.field2);
        }
Example #6
0
        public void Test8b(int i)
        {
            int          num          = i;
            DisplayClass displayClass = new DisplayClass {
                field1 = num,
                field2 = "Hello World!"
            };

            num = 42;
            Console.WriteLine("{0} {1}", displayClass.field1, displayClass.field2);
        }
Example #7
0
        public void Test6(int i)
        {
            DisplayClass displayClass = new DisplayClass {
                field1 = i,
                field2 = "Hello World!"
            };

            if (i < 0)
            {
                i = -i;
            }
            Console.WriteLine("{0} {1}", displayClass.field1, displayClass.field2);
        }
Example #8
0
        public void Test6b(int i)
        {
            int          num          = i;
            DisplayClass displayClass = new DisplayClass {
                field1 = num,
                field2 = "Hello World!"
            };

            if (num < 0)
            {
                num = -num;
            }
            Console.WriteLine("{0} {1}", displayClass.field1, displayClass.field2);
        }
        public void Test5()
        {
            DisplayClass displayClass = new DisplayClass {
                thisField = this,
                field1    = 42,
                field2    = "Hello World!"
            };
            int          field1 = 4711;
            string       field2 = "ILSpy";
            DisplayClass field3;

            if (displayClass.field1 > 100)
            {
                field3 = displayClass;
            }
            else
            {
                field3 = null;
            }
            Console.WriteLine("{0} {1}", field2 + field1, field3);
        }
Example #10
0
        public void Test5()
        {
            DisplayClass displayClass = new DisplayClass {
                thisField = this,
                field1    = 42,
                field2    = "Hello World!"
            };
            NestedDisplayClass nested = new NestedDisplayClass {
                field1 = 4711,
                field2 = "ILSpy"
            };

            if (displayClass.field1 > 100)
            {
                nested.field3 = displayClass;
            }
            else
            {
                nested.field3 = null;
            }
            Console.WriteLine("{0} {1}", nested.field2 + nested.field1, nested.field3);
        }