brendanhay / amazonka

A comprehensive Amazon Web Services SDK for Haskell.
https://amazonka.brendanhay.nz
Other
599 stars 227 forks source link

Many record updates are ambiguous #839

Open ysangkok opened 1 year ago

ysangkok commented 1 year ago

Compiling Amazonka on Stackage nightly-2022-11-19 (which uses GHC 9.4.3), I get many errors like

amazonka-sts                     > [13 of 16] Compiling Amazonka.STS.AssumeRole
amazonka-sts                     > 
amazonka-sts                     > /tmp/stack-dbaaceb93d5a94b4/amazonka-sts-2.0/gen/Amazonka/STS/AssumeRole.hs:843:116: warning: [-Wambiguous-fields]
amazonka-sts                     >     The record update s {sourceIdentity = a} with type AssumeRole is ambiguous.
amazonka-sts                     >     This will not be supported by -XDuplicateRecordFields in future releases of GHC.
amazonka-sts                     >     |
amazonka-sts                     > 843 | assumeRole_sourceIdentity = Lens.lens (\AssumeRole' {sourceIdentity} -> sourceIdentity) (\s@AssumeRole' {} a -> s {sourceIdentity = a} :: AssumeRole)
endgame commented 1 year ago

Thanks, this is due to the DuplicateRecordFields without ambiguous field access proposal.

There is a (not yet accepted) proposal around disambiguating record updates using type signatures, which if I read correctly would mean there's no work for us to do. I think we do nothing for now, defer this to post-2.0 and wait to see how the discussions shake out.

endgame commented 5 months ago

Keep an eye on https://github.com/ghc-proposals/ghc-proposals/pull/537; if it goes through and we have a backwards-compatible disambiguation syntax, then we'll need to update the generator.