Re: [ambiguous occurrence bug?]

2019-03-19 Thread Shayne Fletcher via ghc-devs
On Mon, Mar 18, 2019 at 9:30 PM Ben Gamari wrote: > Shayne Fletcher via ghc-devs writes: > > > 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: >

Re: [ambiguous occurrence bug?]

2019-03-18 Thread Ben Gamari
Shayne Fletcher via ghc-devs 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!" > ``` > >

Re: [ambiguous occurrence bug?]

2019-03-17 Thread Richard Eisenberg
This looks like a bug to me. Post at https://gitlab.haskell.org/ghc/ghc/issues/ Thanks! Richard > On Mar 17, 2019, at 1:50 PM, Shayne Fletcher via ghc-devs > wrote: > > Sorry in advance if I should be posting questions of this kind elsewhere >

Re: [ambiguous occurrence bug?]

2019-03-17 Thread Brandon Allbery
I'm guessing, but I suspect currently the only way to look up a symbol either requires explicit qualification of the symbol name or that the symbol be part of a class or instance declaration that implicitly qualifies method and associated type names. So for the implicit export list to retrieve the

Re: [ambiguous occurrence bug?]

2019-03-17 Thread Shayne Fletcher via ghc-devs
On Sun, Mar 17, 2019 at 2:23 PM Brandon Allbery wrote: > Hm. You're probably right that it should only consider the locally defined > one, > Cool. > but I can see why it would do this > Can you elaborate? Perhaps, > and wonder if there's even a good way to constrain that check currently. >

Re: [ambiguous occurrence bug?]

2019-03-17 Thread Brandon Allbery
Hm. You're probably right that it should only consider the locally defined one, but I can see why it would do this and wonder if there's even a good way to constrain that check currently. On Sun, Mar 17, 2019 at 2:16 PM Shayne Fletcher wrote: > Hi Brandon, > > On Sun, Mar 17, 2019 at 2:09 PM

Re: [ambiguous occurrence bug?]

2019-03-17 Thread Shayne Fletcher via ghc-devs
Hi Brandon, On Sun, Mar 17, 2019 at 2:09 PM Brandon Allbery wrote: > No contradiction: "not those that are imported" means a module which > imports names does not automatically re-export those names to other modules > that import it. So T does indeed export "main", which is imported >

Re: [ambiguous occurrence bug?]

2019-03-17 Thread Brandon Allbery
No contradiction: "not those that are imported" means a module which imports names does not automatically re-export those names to other modules that import it. So T does indeed export "main", which is imported unqualified by Main and thereby causes an ambiguous occurrence. But if T had imported

[ambiguous occurrence bug?]

2019-03-17 Thread Shayne Fletcher via ghc-devs
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