Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.21, 5.0.0-alpha-8, 4.0.21
Description
Consider the following:
class C { private Object obj = 'field' @groovy.transform.TypeChecked void test() { Map<String,String> map = [:].withDefault{ 'entry' } map.with { def x = obj print x } } } new C().test()
This script prints "entry" but the inferred type of "x" is Object not String.