[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
[mono.git] / mcs / tests / test-16.cs
1 using System;
2
3 namespace Mine {
4
5         public class Blah {
6
7                 public static int operator + (Blah i, Blah j)
8                 {
9                         Console.WriteLine ("Base class binary + operator");
10                         return 2; 
11                 }
12
13                 public static implicit operator int (Blah i)
14                 {
15                         Console.WriteLine ("Blah->int");
16                         return 3;
17                 }
18
19                 public static implicit operator byte (Blah i)
20                 {
21                         Console.WriteLine ("Blah->byte");
22                         return 0;
23                 }
24                 
25                 public static implicit operator short (Blah i)
26                 {
27                         Console.WriteLine ("Blah->short");
28                         return 1;
29                 }
30                 
31         }
32
33         public class Foo : Blah {
34
35                 public static int Main ()
36                 {
37                         int number = new Foo () + new Foo () ;
38                         Console.WriteLine (number);
39
40                         Foo tmp = new Foo ();
41                         
42                         int k = tmp;
43
44                         Console.WriteLine ("Convert from Foo to float");
45                         float f = tmp;
46                         Console.WriteLine ("Converted");
47
48                         // The following will not work till we fix our UserCast::Emit
49                         // to convert the return value on the stack.
50                         if (f == 3)
51                                 Console.WriteLine ("Best implicit conversion selected correctly.");
52
53                         Console.WriteLine ("F is {0}", f);
54
55                         if (number == 2 && k == 3)
56                                 return 0;
57                         else
58                                 return 1;
59                 }
60         }
61 }