Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.0.6
-
None
Description
I thought this had been resolved, but I just ran into it again.
The static type checker always infers the strictest possible generic bounds for an inline map.
void consume(Map<String, Object> map) {} void run() { consume([key: 'value']) // compilation fails }
Cannot call example#consume(java.util.Map <java.lang.String, java.lang.Object>) with arguments [java.util.LinkedHashMap <java.lang.String, java.lang.String>]
Explicitly causing the STC to "snap out of it" by adding as Map (no generics required) works.