[Hackage] #350: cabal should check for duplicate module names

#350: cabal should check for duplicate module names ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.8.2 Platform: | ----------------------------+----------------------------------------------- If I write a list like: {{{other-modules: Foo.Bar.Quux, Foo.Bar.Blat, Foo.Bar.Quux}}} in my {{{.cabal}}} file, {{{setup configure}}} will happily accept it. But then when I build, GHC will give me an error message like: {{{ <no location info>: module `blat:Foo.Bar.Quux' is defined in multiple files: Foo/Bar/Quux.hs Foo/Bar/Quux.hs }}} which is very confusing! Can Cabal check for duplicates in the exposed- modules and other-modules lists? -Tim -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/350 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#350: cabal should check for duplicate module names ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by duncan): Actually it does now check for duplicate modules, however I noticed when I was trying it that the check is never triggered because it gets `nub`ed first. The reason is that the `Monoid` instance is used to combine the build info from multiple sections in the `.cabal` file (think of conditional bits) and we use `nub (a ++ b)`. It's not entirely obvious that we should be using `nub`. It means you can specify the same module in multiple conditions and if several get enabled then it's not a problem, rather than them having to be mutually exclusive. I guess we could use something other than `nub` to combine them so that duplicates within a section are preserved as far as to get to the explicit check for them and only single duplicated between sections get merged. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/350#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage