Skip to content

Type-level module alias for functor parameter accepted #13185

@goldfirere

Description

@goldfirere

The following module is accepted:

module type S1 = sig end

module type S2 = functor (X : S1) -> sig module M = X end

This contradicts https://v2.ocaml.org/manual/modulealias.html, which says that the right-hand side of a module M = M0 in a signature cannot be a functor parameter.

I tried weakly to get this to actually misbehave (accept a program that's clearly not type safe) but was unable to do so. But I think my S2 is uninhabited: I was unable to find a module expression with type S2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions