Description
The following code will not compile:
class Account { String id } class GCAccount { List<Account> sfAccounts } class User { List<GCAccount> gcAccounts } @groovy.transform.CompileStatic void foo() { def accounts = (1..10).collect { new Account(id:"Id $it") } def user = new User(gcAccounts:[new GCAccount(sfAccounts:accounts[0..2]),new GCAccount(sfAccounts:accounts[3..4])]) def ids = user.gcAccounts.sfAccounts.id.flatten() println ids } foo()
The error is:
No such property: id for class: java.util.List <java.util.List>
indicating that the generic type inference is incomplete.