Skip to content

Incomplete computation warning on inbuilt return types #260

Open
@nikolaushuber

Description

Certain types currently raise incomplete computation warnings which causes them to not be shown in error traces. One example is Array.mem:

File "array.mli", line 55, characters 0-89:
55 | val mem : 'a -> 'a t -> bool
56 | (*@ b = mem a t
57 |     ensures b = Sequence.mem t.contents a *)
Warning: Incomplete computation of the returned value in the specification of mem. Failure message won't be able to display the expected returned value.

If mem is adapted to

let mem c t = not (mem c t)

The error message reads:

Messages for test Array STM tests:

Gospel specification violation in function mem

  File "array.mli", line 57, characters 12-41:
    b = Sequence.mem t.contents a
  
when executing the following sequence of operations:

  [@@@ocaml.warning "-8"]
  open Array
  let protect f = try Ok (f ()) with e -> Error e
  let sut0 = make 16 'a'
  let sut1 = make 16 'a'
  let r = mem '%' sut1
  (* returned true *)

Similar things can be observed for tuples (see for example tuple_errors.expected) and optionals (e.g. queue_errors.expected). In the latter case ortac should be able to print it, since the type variable is already instantiated at that point.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions