Skip to content

Opus 4.6 fixes or suppresses a bunch of warnings#4098

Open
nikswamy wants to merge 1 commit intomasterfrom
_nik_warnings
Open

Opus 4.6 fixes or suppresses a bunch of warnings#4098
nikswamy wants to merge 1 commit intomasterfrom
_nik_warnings

Conversation

@nikswamy
Copy link
Collaborator

@nikswamy nikswamy commented Feb 6, 2026

No description provided.

reduce (List.flatten docs)
(* -------------------------------------------------------------------- *)
let doc_of_mlmodule_r (fsharp : bool) (mod : mlmodule) : doc =
let rec p_sig (mod : mlmodule) =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing unused code is one way of fixing a warning. 😄

//NS: this assertion has been failing for a while in debug mode; not sure why
assert (task = fst (snd (List.hd !repl_stack)));
let current_task = fst (snd (List.hd !repl_stack)) in
assert (task = current_task);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds useless code at runtime. Assert is a no-op in ML mode, lifting the code outside of the assert extracts it to OCaml and executes it at runtime.

| Op (op_plus, [t1 ; t2]) ->
assert (Ident.string_of_id op_plus = "+") ;
let op_str = Ident.string_of_id op_plus in
assert (op_str = "+") ;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

| Var max_lid ->
assert (Ident.string_of_lid max_lid = "max") ;
let lid_str = Ident.string_of_lid max_lid in
assert (lid_str = "max") ;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seeabove

let generalize' env (is_rec:bool) (lecs:list (lbname&term&comp)) : (list (lbname&univ_names&term&comp&list binder)) =
assert (List.for_all (fun (l, _, _) -> Inr? l) lecs); //only generalize top-level lets
let all_top = List.for_all (fun (l, _, _) -> Inr? l) lecs in
assert all_top; //only generalize top-level lets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants