Fix toString for PositionBridge #12735
                
     Merged
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
I migrated a small project to Scala3, using https://github.com/davidB/scala-maven-plugin.
If everything compiles fine, all good.
But if their is a compile error or warning, instead of showing the source position eg.
path/file.scala:120of the compilation problem, the following is shown instead:[ERROR] dotty.tools.xsbt.PositionBridge@767bb276: could not find Lazy implicit value of type ....It looks like a specific toString impl is missing, and the
Object.toStringis used instead, which is not very helpful for the user to fix compilation problem. 😅 Check for more examples: davidB/scala-maven-plugin#477I debugged the compilation and I think I found the place where the toString of the position is called: https://github.com/sbt/sbt/blob/develop/internal/util-logging/src/main/scala/sbt/util/InterfaceUtil.scala#L176
Even if SBT is relying on an undocumented behavior of the toString of some classes, which should probably be fixed in SBT, a more helpful toString for PositionBridge should not make any harm either.
This PR therefor adds a very basic, but helpful toString impl to PositionBridge.
Note that the other field src is also part of pos, so I skipped it in the toString, to not get the information twice.
Example call path: