Community
Participate
Working Groups
The method def <T> Collection<T> addAll2(Collection<T> collection, Iterable<? extends T> elements){ collection.addAll(elements) //ERROR HERE collection } shows an error, that elements should be an Iterable<? extends T>. If it's written with another generic type instead of ? extends T at the signature the editor shows no bug, but... def <T, U extends T> Collection<T> addAll2(Collection<T> collection, Iterable<U> elements){ collection.addAll(elements) collection } The generated code contains CollectionExtensions.<?>addAll(collection, elements); which is a bug at the method call with type <?>. If you change xtend to collection.<T>addAll(elements) this works again.
The tests for this issue revealed some other problems in the type computation. However, the issue itself was 'mostly' fixed. The following problem remains: def <T, U extends T> Collection<T> addAll2(Collection<T> collection, Iterable<U> elements){ collection.<T>addAll(elements) <<- for now, this expression requires an explicit type arg }
Pushed to master.
Closing all bugs that were set to RESOLVED before Neon.0