Skip to content

Disallow cyclic unboxed types? #10485

@nchataing

Description

@nchataing

Hi!

The current testsuite suggests that we should allow types of the form

type t = A of t [@@unboxed]

Even though it is acceptable, this type is inhabited by no OCaml runtime value (and hence equivalent to the empty type?).

However, accepting it poses problem further down the line in joint work with @gasche : it would needlessly over complicate our cycle detection algorithm (see #10479), which simply rejects the above type after detecting a cycle.

Is it acceptable to change the behavior and reject this kind of declaration, given than it is impossible to generate code that manipulates them?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions