| CicAst.Case (term, indty_ident, outtype, branches) ->
let term_dom = aux loc context term in
let outtype_dom = aux_option loc context outtype in
+ let get_first_constructor = function
+ | [] -> []
+ | ((head, _), _) :: _ -> [ Id head ]
+ in
let do_branch ((head, args), term) =
let (term_context, args_domain) =
List.fold_left
List.fold_left (fun dom branch -> do_branch branch @ dom) [] branches
in
branches_dom @ outtype_dom @ term_dom @
- (match indty_ident with None -> [] | Some ident -> [ Id ident ])
+ (match indty_ident with
+ | None -> get_first_constructor branches
+ | Some ident -> [ Id ident ])
| CicAst.LetIn ((var, typ), body, where) ->
let body_dom = aux loc context body in
let type_dom = aux_option loc context typ in