Skip to content

Fix type inferencing and syntax highlighting for spread arguments and static method missing #1483

@eric-milles

Description

@eric-milles

Consider the following:

void m(String str, List list, Number n) { }
void test(Tuple3<String,List,Long> tuple) {
  m(*tuple)
}
static void sm(Number n) { }
List<Number> numbers
sm(numbers)

When exploring alternatives for GROOVY-11060, some weak points in type inferencing were discovered. "m(*tuple)" is an example of spread arguments; it is shown as unknown (underlined). "sm(numbers)" matches the number of parameters and so StaticImportVisitor transforms it to a StaticMethodCallException. From there, a mismatch between arguments and parameters caused a breakdown in type inferencing for the remainder of the method.

image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions