eric-milles opened a new pull request, #1770:
URL: https://github.com/apache/groovy/pull/1770

   Here is the more controversial change of 
https://github.com/apache/groovy/pull/1766 so it can be debated/evaluated in 
isolation.
   
   A small change in `StaticTypeCheckingSupport#getDistance` can resolve the 
`map["$key"]` issues. I know Cedric stated in 6668 that this should be an STC 
error, but if there is just one method and it accepts String, it will be chosen 
for a GString argument. This change just closes the distance between GString 
and String so that `m(String)` is selected over `m(Object)`. Yes, this puts 
`Map#get` and `Map#getAt` out of alignment for GString arguments, which was a 
stated concern.  But the gain is in alignment of dynamic and static behaviors.
   
   I checked `put` and `putAt` and I think there is consistency with `get` and 
`getAt`.  You can read and write via GString or String interchangeably.  I 
think this is the expectation of most users as described in 6668.
   
   https://github.com/apache/groovy/pull/708
   https://github.com/apache/groovy/pull/1766
   https://issues.apache.org/jira/browse/GROOVY-6668
   https://issues.apache.org/jira/browse/GROOVY-8212


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to