Skip to content
CCPEDIAby Unity Nodes
OPENIssue

`module-prefixes` does not hide the unprefixed module names of prefixed packages

#23698by mrdziubanCreated 04-12-2026

Affected Daml version

Tested on 3.5.2 and 3.7.5

Bug description

When a package has data-dependencies on two versions of the same package, module-prefixes makes the modules of one version available under the specified prefix, but their unprefixed names are still exposed too. Every unqualified import of a module from the package then has an Ambiguous module name error.

This originally came up in https://github.com/canton-network/splice-sv-fa-locking/pull/287#discussion_r4796695784, and @meiersi-da thinks it might be a bug.

To reproduce

  1. Clone mrdziuban/daml-module-prefixes-repro
  2. Run direnv allow or nix develop
  3. Run ./build.sh

When repro-app is compiled, you'll see an error:

File:     /home/matt/Projects/daml-module-prefixes-repro/app/daml/Main.daml
Hidden:   no
Range:    4:8-4:11
Source:   not found
Severity: DsError
Message:
Ambiguous module name ‘Lib’:
  it was found in multiple packages: repro-lib-1.0.0 repro-lib-1.0.1

Expected behavior

The module name Lib from the prefixed repro-lib-1.0.0 package should not be exposed unprefixed. The unprefixed name Lib should unambiguously refer to the module in repro-lib-1.0.1.