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

Side by Side Diff: pkg/analyzer/lib/src/generated/error_verifier.dart

Issue 1531613002: Fix for recording static elements of a prefixed comment reference. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library analyzer.src.generated.error_verifier; 5 library analyzer.src.generated.error_verifier;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import "dart:math" as math; 8 import "dart:math" as math;
9 9
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 5153 matching lines...) Expand 10 before | Expand all | Expand 10 after
5164 } 5164 }
5165 5165
5166 /** 5166 /**
5167 * Check the given [typeReference] and that the [name] is not the reference to 5167 * Check the given [typeReference] and that the [name] is not the reference to
5168 * an instance member. 5168 * an instance member.
5169 * 5169 *
5170 * See [StaticWarningCode.STATIC_ACCESS_TO_INSTANCE_MEMBER]. 5170 * See [StaticWarningCode.STATIC_ACCESS_TO_INSTANCE_MEMBER].
5171 */ 5171 */
5172 bool _checkForStaticAccessToInstanceMember( 5172 bool _checkForStaticAccessToInstanceMember(
5173 ClassElement typeReference, SimpleIdentifier name) { 5173 ClassElement typeReference, SimpleIdentifier name) {
5174 // OK, in comment
5175 if (_isInComment) {
5176 return false;
5177 }
5174 // OK, target is not a type 5178 // OK, target is not a type
5175 if (typeReference == null) { 5179 if (typeReference == null) {
5176 return false; 5180 return false;
5177 } 5181 }
5178 // prepare member Element 5182 // prepare member Element
5179 Element element = name.staticElement; 5183 Element element = name.staticElement;
5180 if (element is! ExecutableElement) { 5184 if (element is! ExecutableElement) {
5181 return false; 5185 return false;
5182 } 5186 }
5183 ExecutableElement memberElement = element as ExecutableElement; 5187 ExecutableElement memberElement = element as ExecutableElement;
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
6200 toCheck.add(type.element); 6204 toCheck.add(type.element);
6201 // type arguments 6205 // type arguments
6202 if (type is InterfaceType) { 6206 if (type is InterfaceType) {
6203 InterfaceType interfaceType = type; 6207 InterfaceType interfaceType = type;
6204 for (DartType typeArgument in interfaceType.typeArguments) { 6208 for (DartType typeArgument in interfaceType.typeArguments) {
6205 _addTypeToCheck(typeArgument); 6209 _addTypeToCheck(typeArgument);
6206 } 6210 }
6207 } 6211 }
6208 } 6212 }
6209 } 6213 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698