diff --git a/jscomp/ml/typecore.ml b/jscomp/ml/typecore.ml index 3dc2d4eeb2..1efff7a344 100644 --- a/jscomp/ml/typecore.ml +++ b/jscomp/ml/typecore.ml @@ -2168,7 +2168,10 @@ and type_expect_ ?in_function ?(recarg=Rejected) env sexp ty_expected = check_duplicates loc env lbl_exp_list; let label_descriptions, representation = match lbl_exp_list, repr_opt with | (_, { lbl_all = label_descriptions; lbl_repres = representation}, _) :: _, _ -> label_descriptions, representation - | [], Some (Record_optional_labels optional_labels as representation) when lid_sexp_list = [] -> + | [], Some (representation) when lid_sexp_list = [] -> + let optional_labels = match representation with + | Record_optional_labels optional_labels -> optional_labels + | _ -> [] in let filter_missing (ld : Types.label_declaration) = let name = Ident.name ld.ld_id in if List.mem name optional_labels then @@ -3663,7 +3666,7 @@ let report_error env ppf = function | Labels_missing labels -> let print_labels ppf = List.iter (fun lbl -> fprintf ppf "@ %s" ( lbl)) in - fprintf ppf "@[Some required record fields are missing:%a@]" + fprintf ppf "@[Some required record fields are missing:%a. If this is a component, add the missing props.@]" print_labels labels | Label_not_mutable lid -> fprintf ppf "The record field %a is not mutable" longident lid diff --git a/lib/4.06.1/unstable/js_compiler.ml b/lib/4.06.1/unstable/js_compiler.ml index e862b85d2d..52bb9d84c5 100644 --- a/lib/4.06.1/unstable/js_compiler.ml +++ b/lib/4.06.1/unstable/js_compiler.ml @@ -41117,7 +41117,10 @@ and type_expect_ ?in_function ?(recarg=Rejected) env sexp ty_expected = check_duplicates loc env lbl_exp_list; let label_descriptions, representation = match lbl_exp_list, repr_opt with | (_, { lbl_all = label_descriptions; lbl_repres = representation}, _) :: _, _ -> label_descriptions, representation - | [], Some (Record_optional_labels optional_labels as representation) when lid_sexp_list = [] -> + | [], Some (representation) when lid_sexp_list = [] -> + let optional_labels = match representation with + | Record_optional_labels optional_labels -> optional_labels + | _ -> [] in let filter_missing (ld : Types.label_declaration) = let name = Ident.name ld.ld_id in if List.mem name optional_labels then @@ -42612,7 +42615,7 @@ let report_error env ppf = function | Labels_missing labels -> let print_labels ppf = List.iter (fun lbl -> fprintf ppf "@ %s" ( lbl)) in - fprintf ppf "@[Some required record fields are missing:%a@]" + fprintf ppf "@[Some required record fields are missing:%a. If this is a component, add the missing props.@]" print_labels labels | Label_not_mutable lid -> fprintf ppf "The record field %a is not mutable" longident lid diff --git a/lib/4.06.1/unstable/js_playground_compiler.ml b/lib/4.06.1/unstable/js_playground_compiler.ml index 1758b5d79d..23eea08e34 100644 --- a/lib/4.06.1/unstable/js_playground_compiler.ml +++ b/lib/4.06.1/unstable/js_playground_compiler.ml @@ -41117,7 +41117,10 @@ and type_expect_ ?in_function ?(recarg=Rejected) env sexp ty_expected = check_duplicates loc env lbl_exp_list; let label_descriptions, representation = match lbl_exp_list, repr_opt with | (_, { lbl_all = label_descriptions; lbl_repres = representation}, _) :: _, _ -> label_descriptions, representation - | [], Some (Record_optional_labels optional_labels as representation) when lid_sexp_list = [] -> + | [], Some (representation) when lid_sexp_list = [] -> + let optional_labels = match representation with + | Record_optional_labels optional_labels -> optional_labels + | _ -> [] in let filter_missing (ld : Types.label_declaration) = let name = Ident.name ld.ld_id in if List.mem name optional_labels then @@ -42612,7 +42615,7 @@ let report_error env ppf = function | Labels_missing labels -> let print_labels ppf = List.iter (fun lbl -> fprintf ppf "@ %s" ( lbl)) in - fprintf ppf "@[Some required record fields are missing:%a@]" + fprintf ppf "@[Some required record fields are missing:%a. If this is a component, add the missing props.@]" print_labels labels | Label_not_mutable lid -> fprintf ppf "The record field %a is not mutable" longident lid diff --git a/lib/4.06.1/whole_compiler.ml b/lib/4.06.1/whole_compiler.ml index 1e97fcd8a1..cf5f1c0a34 100644 --- a/lib/4.06.1/whole_compiler.ml +++ b/lib/4.06.1/whole_compiler.ml @@ -217504,7 +217504,10 @@ and type_expect_ ?in_function ?(recarg=Rejected) env sexp ty_expected = check_duplicates loc env lbl_exp_list; let label_descriptions, representation = match lbl_exp_list, repr_opt with | (_, { lbl_all = label_descriptions; lbl_repres = representation}, _) :: _, _ -> label_descriptions, representation - | [], Some (Record_optional_labels optional_labels as representation) when lid_sexp_list = [] -> + | [], Some (representation) when lid_sexp_list = [] -> + let optional_labels = match representation with + | Record_optional_labels optional_labels -> optional_labels + | _ -> [] in let filter_missing (ld : Types.label_declaration) = let name = Ident.name ld.ld_id in if List.mem name optional_labels then @@ -218999,7 +219002,7 @@ let report_error env ppf = function | Labels_missing labels -> let print_labels ppf = List.iter (fun lbl -> fprintf ppf "@ %s" ( lbl)) in - fprintf ppf "@[Some required record fields are missing:%a@]" + fprintf ppf "@[Some required record fields are missing:%a. If this is a component, add the missing props.@]" print_labels labels | Label_not_mutable lid -> fprintf ppf "The record field %a is not mutable" longident lid