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

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

Issue 1710763002: Support for 'unary-' in DeclarationResolver. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/declaration_resolver_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/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 84d7058766fd008301a11254fd1ebf14e5e6fdc2..cbe941f496b037cba6f4f0e9099f6f86a6b9d446 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -2394,8 +2394,11 @@ class DeclarationResolver extends RecursiveAstVisitor<Object> {
SimpleIdentifier methodName = node.name;
String nameOfMethod = methodName.name;
if (property == null) {
+ String elementName = nameOfMethod == '-' &&
+ node.parameters != null &&
+ node.parameters.parameters.isEmpty ? 'unary-' : nameOfMethod;
_enclosingExecutable = _findWithNameAndOffset(_enclosingClass.methods,
- methodName, nameOfMethod, methodName.offset);
+ methodName, elementName, methodName.offset);
_expectedElements.remove(_enclosingExecutable);
methodName.staticElement = _enclosingExecutable;
} else {
@@ -2404,7 +2407,7 @@ class DeclarationResolver extends RecursiveAstVisitor<Object> {
accessor = _findIdentifier(_enclosingClass.accessors, methodName);
} else if ((property as KeywordToken).keyword == Keyword.SET) {
accessor = _findWithNameAndOffset(_enclosingClass.accessors,
- methodName, methodName.name + '=', methodName.offset);
+ methodName, nameOfMethod + '=', methodName.offset);
_expectedElements.remove(accessor);
methodName.staticElement = accessor;
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/declaration_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698