/*
- * Copyright 2000-2010 JetBrains s.r.o.
+ * Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
if (level < 2) return false;
}
+ if (boundClass1 == null || boundClass2 == null) {
+ return type1 != null && type2 != null && !type1.equals(type2);
+ }
+
return type2 != null && type1 != null && !type1.equals(type2) &&
+ !(boundClass1.isInterface() && boundClass2.isInterface()) &&
(!InheritanceUtil.isInheritorOrSelf(boundClass1, boundClass2, true) ||
!InheritanceUtil.isInheritorOrSelf(boundClass2, boundClass1, true));
}
--- /dev/null
+class Test {
+
+ {
+ Marker<String> cm = forEach(child1(), child2());
+ }
+
+ public static <D> Child1<D> child1() {
+ return null;
+ }
+
+ public static <S> Child2<S> child2() {
+ return null;
+ }
+
+ public static <F, CM extends Marker<F>> CM forEach(CM contents, CM cm) {
+ return null;
+ }
+
+ interface Marker<A> {}
+ static class Parent<S> {}
+
+ static class Child1<D> extends Parent<ChildAttr1> implements Marker<D> {}
+ interface ChildAttr1 {}
+
+ static class Child2<S> extends Parent<ChildAttr2> implements Marker<S> {}
+ interface ChildAttr2 {}
+
+}