Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / errors / cs0121-5.cs
1 // CS0121: The call is ambiguous between the following methods or properties: `V2.operator -(V2, V2)' and `V3.operator -(V3, V3)'
2 // Line: 45
3
4 public struct V3
5 {
6         public float x, y, z;
7
8         public V3 (float ix, float iy, float iz) { x = ix; y = iy; z = iz; }
9
10         static public V3 operator - (V3 lhs, V3 rhs)
11         {
12                 return new V3 (lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z);
13         }
14 }
15
16 public struct V2
17 {
18         public float x, y;
19
20         public V2 (float ix, float iy) { x = ix; y = iy; }
21
22         public static implicit operator V2 (V3 v)
23         {
24                 return new V2 (v.x, v.y);
25         }
26
27         public static implicit operator V3 (V2 v)
28         {
29                 return new V3 (v.x, v.y, 0);
30         }
31
32         static public V2 operator - (V2 lhs, V2 rhs)
33         {
34                 return new V2 (lhs.x - rhs.x, lhs.y - rhs.y);
35         }
36 }
37
38 internal class Test
39 {
40         static void Main ()
41         {
42                 V2 a = new V2 ();
43                 V3 b = new V3 ();
44
45                 V2 s = a - b;
46         }
47 }