title: Work with class in OCaml
body: <p>I want create function with my type <code>test_type</code> in class <code>t</code>. My code: </p>
  
  <pre><code>type test_type = [`t1|`t2]
  
  let get_types =
    function
     | `t1 -&gt; "t1"
     | `t2 -&gt; "t2";;
  
  class type class_types =
    object
      method t_types : test_type
      method test : (string -&gt; string -&gt; test_type -&gt; unit) -&gt; unit
  end;;
  
  class t : class_types =
    object
      method test par1 ?(par2="no par2") ?(par3=`t1) () =
        print_endline("---&gt;"^par1);
        print_endline("---&gt;"^par2);
        print_endline("---&gt;"^get_types par3)
  end;;
  
  let t_run = new t;;
  t_run # test "parametr1" ~par3:`t2 ();;
  </code></pre>
  
  <p>is return error </p>
  
  <pre><code>The class type is not matched by the class type class_types
  The first class type has no method t_types
  </code></pre>
  
  <p>How to do this?</p>