[ambiguous occurrence bug?]

Richard Eisenberg rae at richarde.dev
Mon Mar 18 02:12:46 UTC 2019


This looks like a bug to me. Post at https://gitlab.haskell.org/ghc/ghc/issues/ <https://gitlab.haskell.org/ghc/ghc/issues/>

Thanks!
Richard

> On Mar 17, 2019, at 1:50 PM, Shayne Fletcher via ghc-devs <ghc-devs at haskell.org> wrote:
> 
> 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 <https://www.haskell.org/onlinereport/haskell2010/haskellch5.html>)? If the latter, is this a bug? What am I missing?
> 
> -- 
> Shayne Fletcher
> Language Engineer
> c: +1 917 699 7763
> e: shayne.fletcher at daml.com <mailto:shayne.fletcher at daml.com>
> Digital Asset Holdings, LLC
> 4 World Trade Center                                                        150 Greenwich Street, 47th Floor          <https://maps.google.com/?q=150+Greenwich+Street,+47th+Floor%C2%A0+%C2%A0+%C2%A0+%C2%A0+%C2%A0+New+York,+NY+10007,+USA&entry=gmail&source=g>
> New York, NY 10007, USA <https://maps.google.com/?q=150+Greenwich+Street,+47th+Floor%C2%A0+%C2%A0+%C2%A0+%C2%A0+%C2%A0+New+York,+NY+10007,+USA&entry=gmail&source=g>
> digitalasset.com <http://www.digitalasset.com/>
> 
> This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.digitalasset.com/emaildisclaimer.html <http://www.digitalasset.com/emaildisclaimer.html>. If you are not the intended recipient, please delete this message._______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20190317/58ceef06/attachment.html>


More information about the ghc-devs mailing list