Description
Given the following code :
interface One<T> { void echo(T obj); } interface Two extends One<String> {} class OneImpl implements Two,One<Integer> { public void echo(String obj) { println obj } } def o = new OneImpl()
The "One" interface is implemented twice with two different generic types, which should not be allowed. Here's another example, more complex :
interface Transcoder<T, U> { T transcode(U obj); } interface TranscoderToString<V> extends Transcoder<String, V>{ } abstract class AbstractToStringTranscoder<V> implements TranscoderToString<V> { public String transcode(final V obj) { return obj.toString(); } } class IntegerToStringTranscoder extends AbstractToStringTranscoder<Integer> implements TranscoderToString<Boolean> { }
Attachments
Issue Links
- causes
-
GROOVY-11508 Multiple traits with related generic types cannot be used
- Closed
- relates to
-
GROOVY-10439 No error/warning for @Delegate introducing conflicting interface generics
- Closed