Community
Participate
Working Groups
Given a class Foo and an interface Bar class Foo {} interface Bar { def void bar() } the following gives an error class Bug { def <T extends Foo & Bar> onChange(List<? extends T> list) { list.forEach [ val List<Foo> foos = null foos += it it.bar // ERROR: method bar undefined for type Bug ] } } The upper bound 'Bar' seems to be removed by adding 'it' to the list. Switching the order of 'it.bar' and 'foos+=it' makes the error disappear