Merge pull request #3563 from lewurm/interpreter
[mono.git] / mcs / tests / test-450.cs
index 137e4a49298d4db80fc631f1e319d49d279b03ce..3c70f16ec202c4e1280b0cba1ed966b70ecda748 100644 (file)
@@ -1,21 +1,42 @@
-//
-// This is a test for as expression
-// in custom attribute constructors
-//
-
 using System;
 
-class MyAttribute : Attribute {
+enum E : byte
+{
+       V
+}
 
-       public MyAttribute (string s)
+class A
+{
+       int value;
+       
+       private A (int value)
        {
+               this.value = value;
+       }
+       
+       public static implicit operator byte (A a)
+       {
+               return 6;
        }
-}
-
-[My (null as string)]
-class X {
 
-       static void Main ()
+       public static implicit operator A (int a)
        {
+               return new A (a);
        }
-}
+       
+       public static int Main ()
+       {
+               var a = new A (0);
+               a++;
+               if (a.value != 7)
+                       return 1;
+               
+               var e = E.V;
+               e++;
+               
+               if ((int) e != 1)
+                       return 2;
+               
+               return 0;
+       }
+}
\ No newline at end of file