diff --git a/compiler/damlc/daml-opts/daml-opts/DA/Daml/Options.hs b/compiler/damlc/daml-opts/daml-opts/DA/Daml/Options.hs index c40c5a8e3e9d..d469d92060cb 100644 --- a/compiler/damlc/daml-opts/daml-opts/DA/Daml/Options.hs +++ b/compiler/damlc/daml-opts/daml-opts/DA/Daml/Options.hs @@ -63,7 +63,7 @@ toCompileOpts options@Options{..} reportProgress = , optDefer = Ghcide.IdeDefer False } where - toRenaming aliases = ModRenaming False [(GHC.mkModuleName mod, GHC.mkModuleName alias) | (mod, alias) <- aliases] + toRenaming aliases = ModRenaming True [(GHC.mkModuleName mod, GHC.mkModuleName alias) | (mod, alias) <- aliases] locateInPkgDb :: String -> PackageConfig -> GHC.Module -> IO (Maybe FilePath) locateInPkgDb ext pkgConfig mod | (importDir : _) <- importDirs pkgConfig = do diff --git a/daml-assistant/integration-tests/src/DA/Daml/Assistant/IntegrationTests.hs b/daml-assistant/integration-tests/src/DA/Daml/Assistant/IntegrationTests.hs index ef15e1ac1607..e1f01624d0c6 100644 --- a/daml-assistant/integration-tests/src/DA/Daml/Assistant/IntegrationTests.hs +++ b/daml-assistant/integration-tests/src/DA/Daml/Assistant/IntegrationTests.hs @@ -177,7 +177,7 @@ packagingTests = testGroup "packaging" writeFileUTF8 (projectB "daml" "B.daml") $ unlines [ "daml 1.2" , "module B where" - , "import A" + , "import C" , "import Foo.Bar.Baz" , "b : ()" , "b = a" @@ -194,7 +194,11 @@ packagingTests = testGroup "packaging" , " - daml-prim" , " - daml-stdlib" , " - " <> aDar + , "build-options:" + , "- '--package=(\"a-1.0\", [(\"A\", \"C\")])'" ] + -- the last option checks that module aliases work and modules imported without aliases + -- are still exposed. withCurrentDirectory projectB $ callCommandQuiet "daml build" assertBool "b.dar was not created." =<< doesFileExist bDar , testCaseSteps "Dependency on a package with source: A.daml" $ \step -> withTempDir $ \tmpDir -> do