From e0bb403e111d203e0624977c0df44791597d09de Mon Sep 17 00:00:00 2001 From: Nicolas PENELOUX Date: Wed, 6 Dec 2023 17:23:45 +0100 Subject: [PATCH] correction Unbound PRecord --- flap/src/hopix/hopixTypechecker.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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