Skip to content

Fix type inferencing for multi-level spread-dot operator #813

Open
@eric-milles

Description

@eric-milles

Consider the following:

def strings = [['1','2','3'], ['4','5','6']]
def spread1 = strings*.length()

def table = new Hashtable<String,Integer>()
table.put('a', 1)
table.put('b', 2)
table.put('c', 3)
def spread2 = [table.values()]*.value // "value" refers to the field of java.lang.Integer

Code hover (F2) on spread1 yields List<List<E>> when it should be List<List<Integer>>. Similarly, spread2 infers as List<Collection<E>> when it should be List<Collection<Integer>>.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions