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

Unified Diff: pkg/analyzer/lib/src/generated/static_type_analyzer.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
Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index b3ec3eb61a30dffadb3b6a2dc1be868cfc9ee549..173b03599ee20ec3d0b8ee228f171271b40dbda9 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -607,9 +607,10 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
// If we have explicit arguments, use them
if (typeArguments != null) {
DartType staticType = _dynamicType;
- NodeList<TypeAnnotation> arguments = typeArguments.arguments;
+ NodeList<TypeName> arguments = typeArguments.arguments;
if (arguments != null && arguments.length == 1) {
- DartType argumentType = _getType(arguments[0]);
+ TypeName argumentTypeName = arguments[0];
+ DartType argumentType = _getType(argumentTypeName);
if (argumentType != null) {
staticType = argumentType;
}
@@ -683,13 +684,15 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
if (typeArguments != null) {
DartType staticKeyType = _dynamicType;
DartType staticValueType = _dynamicType;
- NodeList<TypeAnnotation> arguments = typeArguments.arguments;
+ NodeList<TypeName> arguments = typeArguments.arguments;
if (arguments != null && arguments.length == 2) {
- DartType entryKeyType = _getType(arguments[0]);
+ TypeName entryKeyTypeName = arguments[0];
+ DartType entryKeyType = _getType(entryKeyTypeName);
if (entryKeyType != null) {
staticKeyType = entryKeyType;
}
- DartType entryValueType = _getType(arguments[1]);
+ TypeName entryValueTypeName = arguments[1];
+ DartType entryValueType = _getType(entryValueTypeName);
if (entryValueType != null) {
staticValueType = entryValueType;
}
@@ -1562,7 +1565,7 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
*/
DartType _computeStaticReturnTypeOfFunctionDeclaration(
FunctionDeclaration node) {
- TypeAnnotation returnType = node.returnType;
+ TypeName returnType = node.returnType;
if (returnType == null) {
return _dynamicType;
}
@@ -1819,10 +1822,13 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
}
/**
- * Return the type represented by the given type [annotation].
+ * Return the type represented by the given type name.
+ *
+ * @param typeName the type name representing the type to be returned
+ * @return the type represented by the type name
*/
- DartType _getType(TypeAnnotation annotation) {
- DartType type = annotation.type;
+ DartType _getType(TypeName typeName) {
+ DartType type = typeName.type;
if (type == null) {
//TODO(brianwilkerson) Determine the conditions for which the type is
// null.
@@ -2247,7 +2253,10 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
library != null && "dart.dom.html" == library.name;
/**
- * Return `true` if the given [node] is not a type literal.
+ * Return `true` if the given node is not a type literal.
+ *
+ * @param node the node being tested
+ * @return `true` if the given node is not a type literal
*/
bool _isNotTypeLiteral(Identifier node) {
AstNode parent = node.parent;
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698