[ambiguous occurrence bug?]

Ben Gamari ben at smart-cactus.org
Tue Mar 19 01:30:13 UTC 2019


Shayne Fletcher via ghc-devs <ghc-devs at haskell.org> writes:

> Sorry in advance if I should be posting questions of this kind elsewhere
> (please tell me if so!).
>
> Consider this two file program:
> ```
> module T where
> main = undefined
>
> module Main where
> import T
> main = putStrLn "Hello world!"
> ```
>
> Both 8.4.3 and 8.6.3 agree:
> ```
> Main.hs:1:1: error:
>     Ambiguous occurrence ‘main’
>     It could refer to either ‘T.main’,
>                              imported from ‘T’ at Main.hs:2:1-8
>                              (and originally defined at Main.hs:2:1-4)
>                           or ‘Main.main’, defined at Main.hs:5:1
> ```
>
> Is this expected behavior? Does it not contradict "If the export list is
> omitted, all values, types and classes defined in the module are exported,
> but not those that are imported" (
> https://www.haskell.org/onlinereport/haskell2010/haskellch5.html)? If the
> latter, is this a bug? What am I missing?
>
The language you cite from the report makes it sound as though this is a
bug. Can you open a ticket?

Cheers,

- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20190318/e6ec96b0/attachment.sig>


More information about the ghc-devs mailing list