[chapel-lang/chapel] Track places where a symbol was reexported for bet

Branch: refs/heads/master
Revision: 072afb3
Author: lydia-duncan
Log Message:

Merge pull request #16304 from lydia-duncan/betterLineno

Track places where a symbol was reexported for better error message on conflict
[reviewed by @e-kayrakli]

Prior to this change, when a symbol that was re-exported conflicts with another
symbol, we would report the line number as where the symbol was defined.
However, re-exporting brings symbols to a closer distance, and thus we really
should report the line number of the re-export as it is the distance we care
about.

I debated about only tracking this information based on a boolean flag but
backed away from that due to uncertainty about when to pass that flag during
the course of lookupPublicUnqualAccessSyms (the two argument version). Other
calls were set up so that we would only go into printConflictingSymbols when
there was a potential conflict (though I was also uncertain if that would have a
positive impact). Basically, my concern was that the time we would lose if we
call lookup twice because of functions that had the same name (and thus weren’t
actually a problem) was greater than what we would save in the case of
nonconflicting calls. But I can still look into that impact, I just probably
would need a different approach.

Resolves Cray/chapel-private#890

Updates four tests for the new error message.

Passed a full standard paratest with futures

Modified Files:
A test/visibility/import/edgeCases/multipleDef-multipleReexport.chpl
A test/visibility/import/edgeCases/multipleDef-multipleReexport.good
M compiler/include/ResolveScope.h
M compiler/include/scopeResolve.h
M compiler/passes/ResolveScope.cpp
M compiler/passes/scopeResolve.cpp
M test/visibility/import/edgeCases/multipleDef.good
M test/visibility/import/edgeCases/multipleDef2.good
M test/visibility/import/edgeCases/multipleDef3.good
M test/visibility/import/public/rename/multipleDefRenameError.good

Compare: https://github.com/chapel-lang/chapel/compare/90fb12a35b12...072afb37e80d