Open aherrmann-da opened 4 years ago
Based on my reading of the "bad module name" code, it isn't currently an error that the Helper
module is named Helper
instead of Test.Helper
. Suffixes of full module paths are apparently allowed. This should probably be fixed.
On the other hand, it is also strange that a cyclic dependency is detected, but if you take out the import Main
from Helper.daml
you get a very different error:
File: daml/Test/Main.daml
Hidden: no
Range: 3:0-3:18
Source: typecheck
Severity: DsError
Message:
daml/Test/Main.daml:3:1: error:
Could not find module ‘Test.Helper’
It is not a module in the current program, or in any known package.
So, damlc, which error are you really seeing? Is it a cyclic dependency or a missing module? It's contradictory.
A wrong module name due to a missing hierarchical prefix can lead to a misleading error message about cyclic module dependencies. The issue can be reproduced as follows:
daml/Main.daml
daml/Test/Main.daml
daml/Test/Helper.daml
Leads to the following error message about cyclic module dependencies, when in fact the issue is a wrong module name.
This was encountered on DAML SDK HEAD as of a080b47e347277e099167fc59affde9dac313342.