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

Side by Side Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java

Issue 10860012: Add support for metadata annotation syntax (issue 4056) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
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.type; 5 package com.google.dart.compiler.type;
6 6
7 import com.google.common.annotations.VisibleForTesting; 7 import com.google.common.annotations.VisibleForTesting;
8 import com.google.common.base.Joiner; 8 import com.google.common.base.Joiner;
9 import com.google.common.base.Objects; 9 import com.google.common.base.Objects;
10 import com.google.common.collect.ArrayListMultimap; 10 import com.google.common.collect.ArrayListMultimap;
(...skipping 2868 matching lines...) Expand 10 before | Expand all | Expand 10 after
2879 } 2879 }
2880 2880
2881 @Override 2881 @Override
2882 public Void visitMethodDefinition(DartMethodDefinition node) { 2882 public Void visitMethodDefinition(DartMethodDefinition node) {
2883 MethodElement method = node.getElement(); 2883 MethodElement method = node.getElement();
2884 String name = method.getName(); 2884 String name = method.getName();
2885 if (superMembers != null && !method.isConstructor()) { 2885 if (superMembers != null && !method.isConstructor()) {
2886 Collection<Element> overridden = superMembers.removeAll(name); 2886 Collection<Element> overridden = superMembers.removeAll(name);
2887 Elements.setOverridden(method, ImmutableSet.copyOf(overridden)); 2887 Elements.setOverridden(method, ImmutableSet.copyOf(overridden));
2888 // Check for invalid @override metadata. 2888 // Check for invalid @override metadata.
2889 if (overridden.isEmpty() && node.getMetadata().isOverride()) { 2889 if (overridden.isEmpty() && node.getObsoleteMetadata().isOverride()) {
2890 typeError(node.getName(), ResolverErrorCode.INVALID_OVERRIDE_METADAT A); 2890 typeError(node.getName(), ResolverErrorCode.INVALID_OVERRIDE_METADAT A);
2891 } 2891 }
2892 // Check that override is valid. 2892 // Check that override is valid.
2893 for (Element superElement : overridden) { 2893 for (Element superElement : overridden) {
2894 if (!(method.isStatic() && superElement.getModifiers().isStatic())) { 2894 if (!(method.isStatic() && superElement.getModifiers().isStatic())) {
2895 if (canOverride(node.getName(), method.getModifiers(), superElemen t) 2895 if (canOverride(node.getName(), method.getModifiers(), superElemen t)
2896 && !superElement.getModifiers().isStatic()) { 2896 && !superElement.getModifiers().isStatic()) {
2897 switch (superElement.getKind()) { 2897 switch (superElement.getKind()) {
2898 case METHOD: 2898 case METHOD:
2899 checkOverride(node.getName(), method, superElement); 2899 checkOverride(node.getName(), method, superElement);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
3049 for (VariableElement v : parameters) { 3049 for (VariableElement v : parameters) {
3050 if (v.isNamed()) { 3050 if (v.isNamed()) {
3051 named.add(v); 3051 named.add(v);
3052 } 3052 }
3053 } 3053 }
3054 return named; 3054 return named;
3055 } 3055 }
3056 } 3056 }
3057 } 3057 }
3058 } 3058 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698