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

Unified Diff: pkg/analysis_server/lib/src/services/correction/fix_internal.dart

Issue 565023003: Issue 13029. Quick fix to create a function for a Function typed named parameter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/analysis_server/lib/src/services/correction/util.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/correction/fix_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index edd08626d30abb5d8388b9df6dd21e9e95c91091..e244723c1a039027cdabb9f59670699e5a0a6627 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -576,6 +576,7 @@ class FixProcessor {
argument = nameNode;
}
}
+ argument = stepUpNamedExpression(argument);
// should be argument of some invocation
ParameterElement parameterElement = argument.bestParameterElement;
if (parameterElement == null) {
@@ -583,6 +584,10 @@ class FixProcessor {
}
// should be parameter of function type
DartType parameterType = parameterElement.type;
+ if (parameterType is InterfaceType && parameterType.isDartCoreFunction) {
+ ExecutableElement element = new MethodElementImpl('', -1);
+ parameterType = new FunctionTypeImpl.con1(element);
+ }
if (parameterType is! FunctionType) {
return;
}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/correction/util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698