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

Unified Diff: pkg/analyzer/lib/src/generated/element_resolver.dart

Issue 1186033004: Update analyzer to reflect new rules for prefixes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/compile_time_error_code_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/element_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index 7df8d66e686d28351a148fcbe94d4a51c4bff5f8..c047654d1615bf7ad186ea846969b02aa9f7ec4d 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -679,13 +679,11 @@ class ElementResolver extends SimpleAstVisitor<Object> {
return null;
}
if (identical(
- errorCode, StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION)) {
- _resolver.reportErrorForNode(
- StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName,
- [methodName.name]);
- } else if (identical(errorCode, StaticTypeWarningCode.UNDEFINED_FUNCTION)) {
- _resolver.reportErrorForNode(StaticTypeWarningCode.UNDEFINED_FUNCTION,
- methodName, [methodName.name]);
+ errorCode, StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION) ||
+ identical(errorCode,
+ CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT) ||
+ identical(errorCode, StaticTypeWarningCode.UNDEFINED_FUNCTION)) {
+ _resolver.reportErrorForNode(errorCode, methodName, [methodName.name]);
} else if (identical(errorCode, StaticTypeWarningCode.UNDEFINED_METHOD)) {
String targetTypeName;
if (target == null) {
@@ -1116,7 +1114,7 @@ class ElementResolver extends SimpleAstVisitor<Object> {
Expression target, bool useStaticContext, Element element) {
// Prefix is not declared, instead "prefix.id" are declared.
if (element is PrefixElement) {
- element = null;
+ return CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT;
}
if (element is PropertyAccessorElement) {
//
@@ -2322,7 +2320,7 @@ class ElementResolver extends SimpleAstVisitor<Object> {
// Look first in the lexical scope.
//
Element element = _resolver.nameScope.lookup(methodName, _definingLibrary);
- if (element == null || element is PrefixElement) {
+ if (element == null) {
//
// If it isn't defined in the lexical scope, and the invocation is within
// a class, then look in the inheritance scope.
@@ -2577,10 +2575,6 @@ class ElementResolver extends SimpleAstVisitor<Object> {
element = _resolver.nameScope.lookup(
new SyntheticIdentifier("${identifier.name}=", identifier),
_definingLibrary);
- } else if (element is PrefixElement && !identifier.inGetterContext()) {
- element = _resolver.nameScope.lookup(
- new SyntheticIdentifier("${identifier.name}=", identifier),
- _definingLibrary);
}
ClassElement enclosingClass = _resolver.enclosingClass;
if (element == null && enclosingClass != null) {
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/compile_time_error_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698