Skip to content

Instantly share code, notes, and snippets.

@retronym
Last active August 29, 2015 14:22
Show Gist options
  • Save retronym/f5a54ddd30bced7e0285 to your computer and use it in GitHub Desktop.
Save retronym/f5a54ddd30bced7e0285 to your computer and use it in GitHub Desktop.
% java -jar /Applications/eclipse/plugins/org.eclipse.jdt.core_3.10.2.v20150120-1634.jar -classpath rt.jar -1.7 sandbox/Test.java
----------
1. ERROR in /Users/jason/code/scala/sandbox/Test.java (at line 9)
interface s_c_i_MapLike<A, B, This extends s_c_i_MapLike<A, B, This> & s_c_i_Map<A, B>> extends s_c_MapLike<A, B, This> {
^^^^^^^^^
The interface s_c_i_MapLike cannot be implemented more than once with different arguments: s_c_i_MapLike<A,B,s_c_i_Map<A,B>> and s_c_i_MapLike<A,B,This>
----------
2. ERROR in /Users/jason/code/scala/sandbox/Test.java (at line 12)
interface s_c_MapLike<A, B, This extends s_c_MapLike<A, B, This> & s_c_Map<A, B>> {
^^^^^^^
The interface s_c_MapLike cannot be implemented more than once with different arguments: s_c_MapLike<A,B,s_c_Map<A,B>> and s_c_MapLike<A,B,This>
----------
3. ERROR in /Users/jason/code/scala/sandbox/Test.java (at line 16)
interface s_c_i_Map<A, B> extends s_c_Map<A, B>, s_c_i_MapLike<A, B, s_c_i_Map<A, B>> {
^^^^^^^^^
The interface s_c_MapLike cannot be implemented more than once with different arguments: s_c_MapLike<A,B,s_c_i_Map<A,B>> and s_c_MapLike<A,B,s_c_Map<A,B>>
----------
3 problems (3 errors)
% java -jar /Applications/eclipse/plugins/org.eclipse.jdt.core_3.10.2.v20150120-1634.jar -classpath rt.jar -1.8 sandbox/Test.java
----------
1. ERROR in /Users/jason/code/scala/sandbox/Test.java (at line 5)
return map.apply("");
^^^^^
The method apply(String) is ambiguous for the type s_c_i_Map<String,String>
----------
2. ERROR in /Users/jason/code/scala/sandbox/Test.java (at line 9)
interface s_c_i_MapLike<A, B, This extends s_c_i_MapLike<A, B, This> & s_c_i_Map<A, B>> extends s_c_MapLike<A, B, This> {
^^^^^^^^^
The interface s_c_i_MapLike cannot be implemented more than once with different arguments: s_c_i_MapLike<A,B,s_c_i_Map<A,B>> and s_c_i_MapLike<A,B,This>
----------
3. ERROR in /Users/jason/code/scala/sandbox/Test.java (at line 12)
interface s_c_MapLike<A, B, This extends s_c_MapLike<A, B, This> & s_c_Map<A, B>> {
^^^^^^^
The interface s_c_MapLike cannot be implemented more than once with different arguments: s_c_MapLike<A,B,s_c_Map<A,B>> and s_c_MapLike<A,B,This>
----------
4. ERROR in /Users/jason/code/scala/sandbox/Test.java (at line 16)
interface s_c_i_Map<A, B> extends s_c_Map<A, B>, s_c_i_MapLike<A, B, s_c_i_Map<A, B>> {
^^^^^^^^^
The interface s_c_MapLike cannot be implemented more than once with different arguments: s_c_MapLike<A,B,s_c_i_Map<A,B>> and s_c_MapLike<A,B,s_c_Map<A,B>>
----------
4 problems (4 errors)
% javac -source 1.8 sandbox/Test.java
sandbox/Test.java:16: error: s_c_MapLike cannot be inherited with different arguments: <A,B,org.test.util.s_c_Map<A,B>> and <A,B,org.test.util.s_c_i_Map<A,B>>
interface s_c_i_Map<A, B> extends s_c_Map<A, B>, s_c_i_MapLike<A, B, s_c_i_Map<A, B>> {
^
sandbox/Test.java:12: error: s_c_MapLike cannot be inherited with different arguments: <A,B,This> and <A,B,org.test.util.s_c_Map<A,B>>
interface s_c_MapLike<A, B, This extends s_c_MapLike<A, B, This> & s_c_Map<A, B>> {
^
sandbox/Test.java:9: error: s_c_MapLike cannot be inherited with different arguments: <A,B,This> and <A,B,org.test.util.s_c_Map<A,B>>
interface s_c_i_MapLike<A, B, This extends s_c_i_MapLike<A, B, This> & s_c_i_Map<A, B>> extends s_c_MapLike<A, B, This> {
^
3 errors
package org.test.util;
public class Test{
public String foo(s_c_i_Map<String, String> map) {
return map.apply("");
}
}
interface s_c_i_MapLike<A, B, This extends s_c_i_MapLike<A, B, This> & s_c_i_Map<A, B>> extends s_c_MapLike<A, B, This> {
}
interface s_c_MapLike<A, B, This extends s_c_MapLike<A, B, This> & s_c_Map<A, B>> {
public B apply(A a);
}
interface s_c_i_Map<A, B> extends s_c_Map<A, B>, s_c_i_MapLike<A, B, s_c_i_Map<A, B>> {
}
interface s_c_Map<A, B> extends s_c_MapLike<A, B, s_c_Map<A, B>> {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment