Skip to content

Fix type inferencing for overloaded extension methods #1143

@eric-milles

Description

@eric-milles

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions