Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: compiler/java/com/google/dart/compiler/resolver/Elements.java

Issue 10837237: Issue 4383. Calling field without setter should generate problem (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use same text for error as for warning Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/Resolver.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 package com.google.dart.compiler.resolver; 5 package com.google.dart.compiler.resolver;
6 6
7 import com.google.common.annotations.VisibleForTesting; 7 import com.google.common.annotations.VisibleForTesting;
8 import com.google.common.base.Objects; 8 import com.google.common.base.Objects;
9 import com.google.common.collect.ImmutableSet; 9 import com.google.common.collect.ImmutableSet;
10 import com.google.common.collect.Lists; 10 import com.google.common.collect.Lists;
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 public static boolean isArtificialAssertMethod(Element element) { 740 public static boolean isArtificialAssertMethod(Element element) {
741 if (element instanceof MethodElement) { 741 if (element instanceof MethodElement) {
742 MethodElement methodElement = (MethodElement) element; 742 MethodElement methodElement = (MethodElement) element;
743 return Objects.equal(methodElement.getName(), "assert") 743 return Objects.equal(methodElement.getName(), "assert")
744 && methodElement.getEnclosingElement() instanceof LibraryElement 744 && methodElement.getEnclosingElement() instanceof LibraryElement
745 && methodElement.getEnclosingElement().getName().equals("dart://core/c ore_runtime.dart"); 745 && methodElement.getEnclosingElement().getName().equals("dart://core/c ore_runtime.dart");
746 } 746 }
747 return false; 747 return false;
748 } 748 }
749 749
750 /**
751 * @return <code>true</code> if normal field or abstract field with getter.
752 */
753 public static boolean isFieldWithGetter(FieldElement fieldElement) {
754 if (fieldElement.getModifiers().isAbstractField()) {
755 return fieldElement.getGetter() != null;
756 }
757 return true;
758 }
759
760 public static boolean isAbstractFieldWithoutGetter(Element element) {
761 if (element instanceof FieldElement) {
762 FieldElement fieldElement = (FieldElement) element;
763 return fieldElement.getModifiers().isAbstractField() && fieldElement.getGe tter() == null;
764 }
765 return false;
766 }
767
750 } 768 }
OLDNEW
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/Resolver.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698