Skip to content

Static Type Checking on Map Iteration Shows Incorrect Compile Errors #872

@ssadedin

Description

@ssadedin

In the last few days my existing code is suddenly showing compile errors whenever I have enabled static compilation and a Map is being iterated. For example:

image

This code results in this error:

Expected parameter of type java.util.Map$Entry <java.lang.Object, java.lang.Object> but got java.util.Map$Entry <String, Object>

This is happening across many different instances of iterating over Maps, it is occurring with both the two argument closure and single argument closure. The same code compiles successfully when compiled with groovyc.

The only way I seem to be able to get things to work is to remove iteration using closures from the code.

I am running this version of groovy-eclipse:

  Eclipse Groovy Development Tools	3.4.0.v201904131343-e1903	org.codehaus.groovy.eclipse.feature.feature.group	Pivotal Software, Inc.

I am using the 2.4 groovy compiler.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions