haskell / win32

Haskell support for the Win32 API
http://hackage.haskell.org/package/Win32
Other
97 stars 62 forks source link

System.Win32 exports `x` #157

Closed bgamari closed 4 years ago

bgamari commented 4 years ago

It seems like System.Win32 now exports a few rather common symbols, including x. It will cause quite some inconvenience for such a widely-used module to export such a common name. Was this intentional?

Mistuke commented 4 years ago

Hmm no it wasn't. Do you have an example? I don't believe I remember this..

bgamari commented 4 years ago

@Mistuke, for instance, Win32's own registry001 test breaks due to this:

[1 of 1] Compiling Main             ( registry001.hs, registry001.o )

registry001.hs:14:29: error:
    Ambiguous occurrence ‘x’
    It could refer to
       either ‘System.Win32.x’,
              imported from ‘System.Win32’ at registry001.hs:1:1-19
              (and originally defined in ‘System.Win32.Console’)
           or ‘Main.x’, defined at registry001.hs:5:1

it seems that this is due to the x and y fields of the System.Win32.Console.COORD type, which is reexported from System.Win32. The left and right fields of SMALL_RECT will be similarly problematic.

Mistuke commented 4 years ago

Hmm those aren't new but I'll fix them tomorrow

Mistuke commented 4 years ago

yeah, unfortunately the tests require the GHC testsuite driver, so make it hard to test them outside of GHC. Do you need a release for this @bgamari ? I couldn't find any other structs with this issue. The name clashes came from the original struct in c.

bgamari commented 4 years ago

Thanks you for handling this, @mistuke !