Ambiguous occurence error, despite use of DuplicateRecordFields (worked with ghc 8.10.7, not with 9.6.4)

Han Joosten <[email protected]>
Newsgroups gmane.comp.lang.haskell.cafe
Message-ID <CAKzCsfivsBoy0ZcyWGACoLjxhWiZ1y_pvFoYzb06A7s3O1FJ3A@mail.gmail.com>
Hi all,

I am currently migrating a Haskell project that uses ghc 8.10.7 to ghc
9.6.4.

Using the new version, I get errors like

~~~.haskell
Ambiguous occurrence ‘pos’
It could refer to
   either the field ‘pos’ of record ‘PClassify’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:1265:5
       or the field ‘pos’ of record ‘PPurpose’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:1186:5
       or the field ‘pos’ of record ‘P_ViewSegment’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:1129:5
       or the field ‘pos’ of record ‘P_ViewD’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:1080:5
       or the field ‘pos’ of record ‘P_IdentDf’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:1024:5
       or the field ‘pos’ of record ‘P_BoxItem’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:981:9
       or the field ‘pos’ of record ‘TemplateKeyValue’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:959:5
       or the field ‘pos’ of record ‘BoxHeader’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:947:5
       or the field ‘pos’ of record ‘P_SubIfc’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:934:9
       or the field ‘pos’ of record ‘P_Interface’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:899:5
       or the field ‘pos’ of record ‘P_Population’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:870:9
       or the field ‘pos’ of record ‘P_Rule’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:806:5
       or the field ‘pos’ of record ‘PairViewSegment’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:740:9
       or the field ‘pos’ of record ‘P_NamedRel’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:591:5
       or the field ‘pos’ of record ‘PAtomPair’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:467:5
       or the field ‘pos’ of record ‘Pragma’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:415:5
       or the field ‘pos’ of record ‘P_Relation’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:408:5
       or the field ‘pos’ of record ‘Representation’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:339:5
       or the field ‘pos’ of record ‘PConceptDef’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:268:5
       or the field ‘pos’ of record ‘P_Pattern’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:209:5
       or the field ‘pos’ of record ‘Role’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:185:5
       or the field ‘pos’ of record ‘P_RoleRule’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:172:5
       or the field ‘pos’ of record ‘P_Enforce’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:152:5
       or the field ‘pos’ of record ‘MetaData’,
          defined at
/workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:136:5

Previously, it was totally fine to have different data types each have a
field with the same name, as long as you used `DuplicateRecordFields`

I have searched the migration documentation but I couldn't find any clue on
why this has been changed or how to deal with it. I probably missed it.
Any help is mostly appreciated!

Thanks for reading
Cheers,
Han Joosten

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.