Backend error: name clash when satisfying both Iterable and Category
The following code fails to compile with a backend error:
interface Clashing satisfies {<String->String>*}&Category<String> {}
The error is:
source/nameclash/run.ceylon:1: error: Ceylon backend error: name clash: contains(Element) in Category and contains(Object) in Iterable have the same erasure, yet neither overrides the other
interface Clashing satisfies {<String->String>*}&Category<String> {}
^
where Element is a type-variable:
Element extends Object declared in interface Category
ceylon --version reports ceylon version 1.3.3 0d594b3 (Contents May Differ), and it is installed on this Mac OS X Sierra system using Homebrew.
I've confirmed the bug. However, please note that there is a very trivial workaround. Just remove &Category<String>, since it's not doing any real work here, or replace it with &Category<Object>.
Since all Iterables already inherit Category<Object>, you can't "narrow" the sort of Category on a subclass (that would be unsound). Instead, Ceylon just takes the intersection of Category<Object>&Category<String> which is Category<Object> since Category is contravariant.