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

Unified Diff: pkg/analyzer/lib/src/dart/constant/evaluation.dart

Issue 2624283003: Revert "Add support for generic function type syntax, part 1" (TBR) (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
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/utilities.dart ('k') | pkg/analyzer/lib/src/generated/element_resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/constant/evaluation.dart
diff --git a/pkg/analyzer/lib/src/dart/constant/evaluation.dart b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
index 4718171ab6e33ea0d2029acca8287c711599739f..7e477d3c223e2f4dfa426f212debf90a3bf0ac94 100644
--- a/pkg/analyzer/lib/src/dart/constant/evaluation.dart
+++ b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
@@ -1358,9 +1358,9 @@ class ConstantVisitor extends UnifyingAstVisitor<DartObjectImpl> {
return null;
}
DartType elementType = _typeProvider.dynamicType;
- NodeList<TypeAnnotation> typeArgs = node.typeArguments?.arguments;
+ NodeList<TypeName> typeArgs = node.typeArguments?.arguments;
if (typeArgs?.length == 1) {
- DartType type = visitTypeAnnotation(typeArgs[0])?.toTypeValue();
+ DartType type = visitTypeName(typeArgs[0])?.toTypeValue();
if (type != null) {
elementType = type;
}
@@ -1393,15 +1393,13 @@ class ConstantVisitor extends UnifyingAstVisitor<DartObjectImpl> {
}
DartType keyType = _typeProvider.dynamicType;
DartType valueType = _typeProvider.dynamicType;
- NodeList<TypeAnnotation> typeArgs = node.typeArguments?.arguments;
+ NodeList<TypeName> typeArgs = node.typeArguments?.arguments;
if (typeArgs?.length == 2) {
- DartType keyTypeCandidate =
- visitTypeAnnotation(typeArgs[0])?.toTypeValue();
+ DartType keyTypeCandidate = visitTypeName(typeArgs[0])?.toTypeValue();
if (keyTypeCandidate != null) {
keyType = keyTypeCandidate;
}
- DartType valueTypeCandidate =
- visitTypeAnnotation(typeArgs[1])?.toTypeValue();
+ DartType valueTypeCandidate = visitTypeName(typeArgs[1])?.toTypeValue();
if (valueTypeCandidate != null) {
valueType = valueTypeCandidate;
}
@@ -1551,7 +1549,8 @@ class ConstantVisitor extends UnifyingAstVisitor<DartObjectImpl> {
_typeProvider.symbolType, new SymbolState(buffer.toString()));
}
- DartObjectImpl visitTypeAnnotation(TypeAnnotation node) {
+ @override
+ DartObjectImpl visitTypeName(TypeName node) {
DartType type = evaluateType(node.type);
if (type == null) {
return super.visitTypeName(node);
@@ -1559,9 +1558,6 @@ class ConstantVisitor extends UnifyingAstVisitor<DartObjectImpl> {
return typeConstant(type);
}
- @override
- DartObjectImpl visitTypeName(TypeName node) => visitTypeAnnotation(node);
-
/**
* Create an error associated with the given [node]. The error will have the
* given error [code].
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/utilities.dart ('k') | pkg/analyzer/lib/src/generated/element_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698