Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/stale-compiler-comments.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix stale comments in the compiler and the `Private_label` entry of the error variant catalog. https://github.com/rescript-lang/rescript/pull/8851
Comment thread
cknitt marked this conversation as resolved.
Resolved
1 change: 0 additions & 1 deletion compiler/core/lam_compile_primitive.ml
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,6 @@ let translate output_prefix loc (cxt : Lam_compile_context.t)
~callee:(Lam_compile_external_call.jsx_callee jsx_ffi)
~tag ~spread ~props ~children ~key ~multi:jsx_multi
~fragment:jsx_fragment)
(* FIXME, this can be removed later *)
| Pis_poly_var_block -> E.is_type_object (Ext_list.singleton_exn args)
| Pduprecord -> (
match args with
Expand Down
4 changes: 2 additions & 2 deletions compiler/ml/clflags.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let output_name = ref (None : string option) (* -o *)

and include_dirs = ref ([] : string list) (* -I *)

and debug = ref false (* -g *)
and debug = ref false (* set in Bs_conditional_initial *)

and nopervasives = ref false (* -nopervasives *)

Expand All @@ -19,7 +19,7 @@ and open_modules = ref [] (* -open *)

and real_paths = ref true (* -short-paths *)

and transparent_modules = ref false (* -trans-mod *)
and transparent_modules = ref false (* -no-alias-deps *)
let dump_source = ref false (* -dsource *)
let dump_parsetree = ref false (* -dparsetree *)

Expand Down
3 changes: 2 additions & 1 deletion compiler/ml/clflags.mli
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ val assume_no_mli : mli_status ref
val dont_record_crc_unit : string option ref
val bs_gentype : bool ref

(* Keep JSX in the output ([-bs-jsx-preserve]); read by translcore, and by
js_dump through [Js_config] *)
val jsx_preserve : bool ref

(* Keep JSX in the output ([-bs-jsx-preserve]); read by translcore *)
val no_assert_false : bool ref
val dump_location : bool ref
4 changes: 1 addition & 3 deletions compiler/ml/lambda.ml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ type eliminated = Identity | Ignore
the spread props (if [jsx_spread]), one value per [jsx_props] entry, the
children ([jsx_children] of them) and the key (if [jsx_key]). *)
type jsx_element = {
jsx_name: string; (* name of the external, for the fallback call *)
jsx_name: string; (* name of the external, only printed by [Printlambda] *)
jsx_ffi: External_ffi_types.external_decl;
jsx_multi: bool; (* [jsxs]: each child is a separate argument *)
jsx_fragment: bool; (* the tag is the JSX module's [jsxFragment] *)
Expand Down Expand Up @@ -258,8 +258,6 @@ type primitive =
| Phash_mixint
| Phash_mixstring
| Phash_finalmix
(* Test if the argument is a block or an immediate integer *)
(* Test if the (integer) argument is outside an interval *)
(* Test if the argument is null or undefined *)
| Pis_null_undefined
(* exn *)
Expand Down
2 changes: 1 addition & 1 deletion compiler/ml/lambda.mli
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ type eliminated = Identity | Ignore
the spread props (if [jsx_spread]), one value per [jsx_props] entry, the
children ([jsx_children] of them) and the key (if [jsx_key]). *)
type jsx_element = {
jsx_name: string; (* name of the external, for the fallback call *)
jsx_name: string; (* name of the external, only printed by [Printlambda] *)
jsx_ffi: External_ffi_types.external_decl;
jsx_multi: bool; (* [jsxs]: each child is a separate argument *)
jsx_fragment: bool; (* the tag is the JSX module's [jsxFragment] *)
Expand Down
3 changes: 2 additions & 1 deletion compiler/ml/rec_check.ml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ let rec classify_expression : Typedtree.expression -> sd =
Static
| Texp_apply {funct = {exp_desc = Texp_ident (_, _, vd)}} when is_ref vd ->
Static
(* A dict is built by calls, see [Translcore] *)
(* A dict literal is built by the [Pmakedict] and [Pdict_spread] primitives,
see [Translcore] *)
| Texp_apply _ | Texp_dict _ | Texp_match _ | Texp_ifthenelse _
| Texp_object_get _ | Texp_object_set _ | Texp_field _ | Texp_assert _
| Texp_try _ | Texp_tagged_template _ | Texp_template _ ->
Expand Down
6 changes: 3 additions & 3 deletions compiler/ml/typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2648,9 +2648,9 @@ and type_expect_ ?deprecated_context ~context ?(recarg = Rejected) env sexp
in
(if should_unify_expected_result_before_typing_lowered_apply funct sargs
then
(* Lowered syntax like dict literals and async wrappers becomes a regular
application, so thread the expected result type into the application
before typing its arguments. *)
(* The async wrapper is lowered to a regular application, so thread the
expected result type into the application before typing its
arguments. *)
let _, ty_res =
filter_arrow_n ~env funct.exp_type
(List.map (fun _ -> Asttypes.Nolabel) sargs)
Expand Down
5 changes: 3 additions & 2 deletions compiler/syntax/src/res_parsetree_viewer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,9 @@ let should_inline_rhs_binary_expr rhs =
true
| _ -> false

(* Attributes on a module expression print before it and bind less tightly
than an application or a constraint *)
(* Attributes on a module expression bind less tightly than an application or
a constraint. Most module expressions print them before themselves, but an
await prints them after [await], and a functor on its first parameter. *)
let mod_expr_has_attributes (mod_expr : Parsetree.module_expr) =
mod_expr.pmod_attributes <> []

Expand Down
5 changes: 3 additions & 2 deletions tests/ERROR_VARIANTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ Source: `type error` in [typecore.ml](../compiler/ml/typecore.ml).
| `Undefined_method` | ✓ | `super_errors_multi/Cross_module_alias_dot_access`, `undefined_method` | |
| `Object_field_not_mutable` | ✓ | `object_write_closed_row`, `object_write_alias`, `object_write_after_forgetting`, `object_private_row_write`, `object_private_row_write_through_signature` | Assignment to a field without `@set`. `object_write_alias` pins that promotion is per equivalence class, and `object_write_after_forgetting` pins that a coercion never grants write capability. The private-row fixtures pin that a `Tconstr` row terminator is structurally open but cannot be strengthened: writing through `type t = private {.."x": int}` (directly or via a signature) is rejected, matching `unify_mutability`. |
| `Private_type` | ✓ | `private_type_construction.res` | |
| `Private_label` | ✓ | `private_label.res` | |
| `Not_subtype` | ✓ | `subtype_*.res`, `coercion_arity_mismatch.res`, `dict_show_no_coercion.res`, etc. | |
| `Abstract_wrong_label` | ✓ | `abstract_wrong_label.res` | Multi-arg function literal where an inner argument label doesn't match the expected arrow's label (e.g. `let f: (~a, ~b) => int = (~a, ~c) => …`). |
| `Scoping_let_module` | ✓ | `scoping_let_module.res` | |
Expand Down Expand Up @@ -559,7 +558,9 @@ warnings still fire.

Fixtures follow the naming convention `warning_<NN>_<description>.res`
so coverage gaps stay greppable. Warning 11 (`Unused_match`) is covered by
`warning_11_equivalent_string_patterns.res`.
`warning_11_equivalent_string_patterns.res`, and warning 111
(`Bs_private_record_mutation`, a write to a private record field) by
`private_label.res`.

### Removed warnings

Expand Down
Loading