Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.0
-
None
Description
If someone uses the property notation to get the key or the value of a map entry, the property type is not inferred properly. The workaround is to use a getter instead.
Test case:
Map.Entry<Date, Integer> entry @ASTTest(phase=INSTRUCTION_SELECTION, value={ assert node.getNodeMetaData(INFERRED_TYPE) == make(Date) }) def k = entry?.key @ASTTest(phase=INSTRUCTION_SELECTION, value={ assert node.getNodeMetaData(INFERRED_TYPE) == Integer_TYPE }) def v = entry?.value
Attachments
Issue Links
- is depended upon by
-
GROOVY-5587 Map.Entry<K,V>#key and #value fail to infer type correctly under @StaticCompile
- Closed