using SCG = System.Collections.Generic;

variant V {
  | A { x : int }
  | B   
  | C { y : string }
}

class C  {
   public static foo (s : SCG.IEnumerable [int], mutable ini : int) : int {
       foreach (x in s)
         ini += x;
       ini
   }
 
   
   public static bar (x : string) : string { 
       System.Console.WriteLine (x);
       x 
   }   
}

def x = C.foo ([1,2,3], 10);
System.Console.WriteLine (x);
System.Console.WriteLine (
  C.bar (
    C.bar (
      C.bar ( 
        "ddd")))
 );
     
System.Console.WriteLine (x); 

def x = V.A (1) : V;
match (x) {
  | C (c) when 1 == 0 =>     
      System.Console.WriteLine (c);
    
  | A (a) 
  | B with a = 1 =>
     System.Console.WriteLine (a);
      System.Console.WriteLine (a);
    
  | C (c) when 1 == 1 => 
      System.Console.WriteLine (c);
}

System.Console.WriteLine (x); 
