Closed raehik closed 1 year ago
@raehik what error are you seeing?
I wonder if I am running into the same thing, coming via nix build
following instructions generated w/ cabal2nix
(which presumably uses the hackage release) w/ GHC 9.4.3:
Building library for optics-0.4.2..
[1 of 1] Compiling Optics ( src/Optics.hs, dist/build/Optics.o, dist/build/Optics.dyn_o )
[1 of 1] Compiling Optics ( src/Optics.hs, dist/build/Optics.p_o )
Preprocessing test suite 'optics-tests' for optics-0.4.2..
Building test suite 'optics-tests' for optics-0.4.2..
[1 of 9] Compiling Optics.Tests.Properties ( tests/Optics/Tests/Properties.hs, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Properties.o, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Properties.dyn_o )
[2 of 9] Compiling Optics.Tests.Utils ( tests/Optics/Tests/Utils.hs, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Utils.o, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Utils.dyn_o )
[3 of 9] Compiling Optics.Tests.Misc ( tests/Optics/Tests/Misc.hs, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Misc.o, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Misc.dyn_o )
[4 of 9] Compiling Optics.Tests.Labels.TH ( tests/Optics/Tests/Labels/TH.hs, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Labels/TH.o, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Labels/TH.dyn_o )
[5 of 9] Compiling Optics.Tests.Labels.Generic ( tests/Optics/Tests/Labels/Generic.hs, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Labels/Generic.o, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Labels/Generic.dyn_o )
tests/Optics/Tests/Labels/Generic.hs:72:15: error:
Ambiguous occurrence ‘name’
It could refer to
either the field ‘name’ of record ‘Human’,
defined at tests/Optics/Tests/Labels/Generic.hs:27:5
or the field ‘name’ of record ‘Fish’,
defined at tests/Optics/Tests/Labels/Generic.hs:22:16
or the field ‘name’ of record ‘Mammal’,
defined at tests/Optics/Tests/Labels/Generic.hs:17:11
|
72 | label1rhs s = name (s :: Human a)
| ^^^^
tests/Optics/Tests/Labels/Generic.hs:80:15: error:
Ambiguous occurrence ‘name’
It could refer to
either the field ‘name’ of record ‘Human’,
defined at tests/Optics/Tests/Labels/Generic.hs:27:5
or the field ‘name’ of record ‘Fish’,
defined at tests/Optics/Tests/Labels/Generic.hs:22:16
or the field ‘name’ of record ‘Mammal’,
defined at tests/Optics/Tests/Labels/Generic.hs:17:11
|
80 | label3rhs s = name (fish s :: Fish)
| ^^^^
[6 of 9] Compiling Optics.Tests.Eta ( tests/Optics/Tests/Eta.hs, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Eta.o, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Eta.dyn_o )
[7 of 9] Compiling Optics.Tests.Core ( tests/Optics/Tests/Core.hs, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Core.o, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Core.dyn_o )
[8 of 9] Compiling Optics.Tests.Computation ( tests/Optics/Tests/Computation.hs, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Computation.o, dist/build/optics-tests/optics-tests-tmp/Optics/Tests/Computation.dyn_o )
confirmed that a local clone at latest (978bc13
) of the repo succeeds w/ the same GHC/cabal.
I ran into this issue as well. Can reproduce with nix build nixpkgs#haskell.packages.ghc94.optics
462 adapted some code to GHC 9.4, specifically some tests, but these changes haven't been released on Hackage. As such, the tests fail on GHC 9.4 on the latest release.