Consider the following:
Map<String, String> map = [foo:'bar']
assert map['foo'].toUpperCase() == 'BAR'
When executed, the runtime selects DefaultGroovyMethods#getAt(Object,String): Object for the subscript operation. However, the editor is inferring DefaultGroovyMethods#getAt(Map,Object): String and so "toUpperCase" is highlighted as an instance method of String. Since the return type is Object the method should be highlighted as unknown (underlined).
NOTE: There are separate issues filed to handle the oddities that result from having getAt(Object,String) and putAt(Object,String,Object) extension methods.
Consider the following:
When executed, the runtime selects
DefaultGroovyMethods#getAt(Object,String): Objectfor the subscript operation. However, the editor is inferringDefaultGroovyMethods#getAt(Map,Object): Stringand so "toUpperCase" is highlighted as an instance method of String. Since the return type is Object the method should be highlighted as unknown (underlined).NOTE: There are separate issues filed to handle the oddities that result from having
getAt(Object,String)andputAt(Object,String,Object)extension methods.