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

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

Issue 2613383003: Add support for generic function type syntax, part 1 (Closed)
Patch Set: Created 3 years, 11 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
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 c96165df580ab1a8d3d7abbc1e174a248762b90d..325f7235511705dfbbd386a875b094eab0933dfb 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -570,7 +570,7 @@ class FixProcessor {
AstNode variableList = declaration.parent;
if (variableList is VariableDeclarationList &&
variableList.variables.length == 1) {
- TypeName typeNode = variableList.type;
+ TypeAnnotation typeNode = variableList.type;
if (typeNode != null) {
Expression initializer = coveredNode;
DartType newType = initializer.bestType;
@@ -1436,7 +1436,7 @@ class FixProcessor {
void _addFix_illegalAsyncReturnType() {
// prepare the existing type
- TypeName typeName = node.getAncestor((n) => n is TypeName);
+ TypeAnnotation typeName = node.getAncestor((n) => n is TypeAnnotation);
_replaceTypeWithFuture(typeName);
// add proposal
_addFix(DartFixKind.REPLACE_RETURN_TYPE_FUTURE, []);
@@ -2825,7 +2825,7 @@ class FixProcessor {
}
}
- void _replaceTypeWithFuture(TypeName typeName) {
+ void _replaceTypeWithFuture(TypeAnnotation typeName) {
InterfaceType futureType = context.typeProvider.futureType;
// validate the type
DartType type = typeName?.type;

Powered by Google App Engine
This is Rietveld 408576698