Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 857 Bytes

5022.md

File metadata and controls

34 lines (23 loc) · 857 Bytes

5022

Names have "statuses", which can be one of:

  • exception
  • constructor
  • value

These statuses must be compatible for the purposes of matching a structure against a signature.

exception Foo

structure S
  : sig    exception E       end
  = struct val       E = Foo end
(** ^^^^^^ incompatible identifier statuses: `E` *)

The most specific status is "exception", and the least is "value". This is because an exception constructor is also generally a constructor, and all constructors are values.

Generally, for the identifier statuses to be compatible, the status of the identifier provided in the structure must be at least as specific as the one requested in the signature.

To fix

Ensure the names have compatible statuses.

exception Foo

structure S
  : sig    exception E       end
  = struct exception E = Foo end