GROOVY-5981: @TypedChecked error when using generics

added non regression test