| Index: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| index 49694ff9d1629c016479d627c9ab3d0cdf93f045..1ca3593b0e7cf4e0710d47a3d511ee05466988a6 100644
|
| --- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| +++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| @@ -1569,12 +1569,8 @@ public class TypeAnalyzer implements DartCompilationPhase {
|
|
|
| private void checkIllegalPrivateAccess(DartNode diagnosticNode, Element element, String name) {
|
| if (DartIdentifier.isPrivateName(name)) {
|
| - if (element != null) {
|
| - Element enclosingLibrary = Elements.getLibraryElement(currentMethod);
|
| - Element identifierEnclosingLibrary = Elements.getLibraryElement(element);
|
| - if (!enclosingLibrary.equals(identifierEnclosingLibrary)) {
|
| - onError(diagnosticNode, TypeErrorCode.ILLEGAL_ACCESS_TO_PRIVATE, name);
|
| - }
|
| + if (!Elements.areSameLibrary(currentMethod, element)) {
|
| + onError(diagnosticNode, TypeErrorCode.ILLEGAL_ACCESS_TO_PRIVATE, name);
|
| }
|
| }
|
| }
|
|
|