Bug 550863 - private access among nest mates is incompatible with copy
inheritance
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
index d2b4266..eb6c859 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -3729,6 +3729,12 @@
if (options.targetJDK < ClassFileConstants.JDK11 ||
options.complianceLevel < ClassFileConstants.JDK11)
return false; // default false if level less than 11
+//{ObjectTeams: in anticipation of copy-inheritance, role-to-team access cannot leverage JEP 181 access.
+ if (isRole() && TypeBinding.equalsEquals(enclosingType(), other))
+ return false;
+ if (other.isRole() && TypeBinding.equalsEquals(other.enclosingType(), this))
+ return false;
+// SH}
SourceTypeBinding otherHost = other.getNestHost();
return TypeBinding.equalsEquals(this, other) ||