diff --git a/flap/src/hopix/hopixTypechecker.ml b/flap/src/hopix/hopixTypechecker.ml index 409bee1..afab0d9 100644 --- a/flap/src/hopix/hopixTypechecker.ml +++ b/flap/src/hopix/hopixTypechecker.ml @@ -269,7 +269,10 @@ and pattern_record let label = fst(List.hd plist) in let type_cons,_,labels = let LId label_name = label.value in - HopixTypes.lookup_type_constructor_of_label label.position label.value tenv + try HopixTypes.lookup_type_constructor_of_label label.position label.value tenv with + | HopixTypes.Unbound (pos, Label (LId i)) -> + HopixTypes.type_error pos (Printf.sprintf "There is no type definition for label `%s'." label_name ) + (* Printf.sprintf "erreur message ici"*) in