Skip to content

Dune allows the creation of projects starting with numbers and the error message when building doesn't say it can't #8252

@hughesjs

Description

@hughesjs

Expected Behavior

Dune should refuse to create a project with a name that begins with a digit.
If Dune attempts to build a module whose name starts with a digit, the error message should indicate that it can't do so.

Actual Behavior

It creates the project skeleton.
The error on build reads:

Error: "01_module" is an 
invalid module name. Module names must be non-empty and composed only 
of the following characters: 'A'..'Z', 'a'..'z', '_', ''' or '0'..'9'. 
Hint: M01_calorie_counting would be a correct module name

Which, while the hint is useful, would actually imply that the name is okay as is.

Reproduction

dune init project 01_module
cd 01 module
dune build

Specifications

  • Version of dune (output of dune --version): 3.9.1
  • Version of ocaml (output of ocamlc --version) 5.0.0
  • Operating system (distribution and version): 6.4.4-arch1-1

Metadata

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