Skip to content

modules.vera fails with E609: Option defined in both imported modules #360

@aallan

Description

@aallan

Running vera run examples/modules.vera --fn clamp -- 100 0 42 fails:

[E609] Error at examples/modules.vera, line 4, column 1:
    import vera.collections(List, Option);
  Data type 'Option' is defined in both imported module 'vera.math' and 'vera.collections'.

The prelude injects Option<T> into every module. When a module imports two other modules that both re-export prelude types (like Option), the flat compilation strategy (C7e) sees duplicate definitions.

The example passes vera check and vera verify but fails at vera run.

Reproduction

vera run examples/modules.vera --fn clamp -- 100 0 42

Related: #187 (module-qualified call disambiguation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcodegenCode generation backendmodule-systemCross-file module system

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions