EncoderReplacementFallbackBuffer.Reset() did not really reset its internals.
[mono-project/dkf.git] / mcs / tests / test-786.cs
blob36cc025ecef486864f85ee550395ed7e30f553e8
1 using System;
3 public class A
5 public static int Counter;
6 public static implicit operator string (A c)
8 ++Counter;
9 return "A-class";
12 public static implicit operator Delegate (A c)
14 return null;
18 public struct B
20 public static int Counter;
21 public static implicit operator string (B c)
23 ++Counter;
24 return "B-struct";
28 public struct D
30 public static int Counter;
31 public static implicit operator Delegate (D d)
33 ++Counter;
34 return null;
38 public struct E
40 public static int Counter;
41 public static implicit operator bool (E d)
43 ++Counter;
44 return true;
48 class Program
50 public static int Main ()
52 if (new B () != new B () || B.Counter != 2)
53 return 1;
55 if (new B () != "B-struct" || B.Counter != 3)
56 return 2;
58 if (new B () == null || B.Counter != 4) {
59 // FIXME: Incorrect null lifting
60 //return 3;
63 if (new D () != new D () || D.Counter != 2)
64 return 10;
66 if (new D () != null || D.Counter != 3) {
67 // FIXME: Incorrect null lifting
68 //return 11;
71 if (new A () != "A-class" || A.Counter != 1)
72 return 20;
74 if (new A () == null || A.Counter != 1)
75 return 21;
77 if (new E () != new E () || E.Counter != 2)
78 return 31;
80 Console.WriteLine ("ok");
81 return 0;