Commits

Anonymous committed fd824c2

Dispatch_method returns type_desc, not uti

Comments (0)

Files changed (1)

       [ Simple of type_name
       | Sum_type of (R.ubox -> (variant_name * array ubox))
       | Record_type of (R.ubox -> array (field_name * ubox))
-      | Dispatch_method of (meth_name -> R.uti)
+      | Dispatch_method of (meth_name -> type_desc)
       | Lambda of R.uti and R.uti and (unit -> R.ubox)
       ]
     and ubox =
       [ Simple of type_name
       | Sum_type of (R.ubox -> (variant_name * array R.ubox))
       | Record_type of (R.ubox -> array (field_name * R.ubox))
-      | Dispatch_method of (meth_name -> R.uti)
+      | Dispatch_method of (meth_name -> type_desc)
       | Lambda of R.uti and R.uti and (unit -> R.ubox)
       ]
     ;
    [ Simple tn -> tn
    | Sum_type (* type_desc_sum *) _destr -> "(some sum type)"
    | Record_type (* type_desc_record *) _destr -> "(some record type)"
-   | Dispatch_method dm -> type_name_of_type_desc ((dm "type_name")#type_desc)
+   | Dispatch_method dm -> type_name_of_type_desc (dm "type_name")
    | Lambda uti_a uti_b _do_apply ->
-       let spine = get_lambda_spine uti_b in
+       let spine = get_lambda_spine uti_b uti_b#type_desc in
        let arrow_components = [uti_a :: spine] in
        Printf.sprintf "(%s)"
          (String.concat
          )
    ]
 
-and get_lambda_spine uti =
-  match uti#type_desc with
+and get_lambda_spine uti type_desc =
+  match type_desc with
    [ ( Simple _
      | Sum_type _
      | Record_type _
          [uti]
 
    | Dispatch_method dm ->
-       get_lambda_spine (dm "type_name")
+       get_lambda_spine uti (dm "type_name")
 
    | Lambda uti_a uti_b _do_apply ->
-       [uti_a :: get_lambda_spine uti_b]
+       [uti_a :: get_lambda_spine uti_b uti_b#type_desc]
    ]
 
 and uti_type_name