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

Unified Diff: pkg/analyzer/lib/src/summary/idl.dart

Issue 2719353002: First cut at idl changes (Closed)
Patch Set: address comments Created 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/idl.dart
diff --git a/pkg/analyzer/lib/src/summary/idl.dart b/pkg/analyzer/lib/src/summary/idl.dart
index 3389fee6f4c634f6797c63c226bbb3d6618f8781..bda2d8ad218d1fbe3f64858fa15c7721b494cd14 100644
--- a/pkg/analyzer/lib/src/summary/idl.dart
+++ b/pkg/analyzer/lib/src/summary/idl.dart
@@ -356,8 +356,8 @@ abstract class CodeRange extends base.SummaryClass {
}
/**
- * Summary information about a reference to a an entity such as a type, top
- * level executable, or executable within a class.
+ * Summary information about a reference to an entity such as a type, top level
+ * executable, or executable within a class.
*/
abstract class EntityRef extends base.SummaryClass {
/**
@@ -448,6 +448,13 @@ abstract class EntityRef extends base.SummaryClass {
*/
@Id(1)
List<EntityRef> get typeArguments;
+
+ /**
+ * If this is a function type, the type parameters defined for the function
+ * type (if any).
+ */
+ @Id(7)
+ List<UnlinkedTypeParam> get typeParameters;
}
/**
@@ -1096,6 +1103,31 @@ enum ReferenceKind {
}
/**
+ * Enum used to indicate the style of a typedef.
+ */
+enum TypedefStyle {
+ /**
+ * A typedef that defines a non-generic function type. The syntax is
+ * ```
+ * 'typedef' returnType? identifier typeParameters? formalParameterList ';'
+ * ```
+ * The typedef can have type parameters associated with it, but the function
+ * type that results from applying type arguments does not.
+ */
+ functionType,
+
+ /**
+ * A typedef that defines a generic function type. The syntax is
Paul Berry 2017/02/28 20:43:56 Nit: I would describe this as "A typedef that defi
Brian Wilkerson 2017/03/07 17:20:32 In the process of shortening the line below I thin
Paul Berry 2017/03/07 17:56:21 I still think it's confusing to say "A typedef tha
Brian Wilkerson 2017/03/07 18:21:40 Ok, that seems like a better alternative, so I upd
+ * ```
+ * 'typedef' identifier typeParameters? '=' returnType? 'Function' typeParameters? parameterTypeList ';'
Paul Berry 2017/02/28 20:43:56 Nit: long line.
+ * ```
+ * Both the typedef itself and the function type that results from applying
+ * type arguments can have type parameters.
+ */
+ genericFunctionType
+}
+
+/**
* Index information about a unit in a [PackageIndex].
*/
abstract class UnitIndex extends base.SummaryClass {
@@ -2637,7 +2669,14 @@ abstract class UnlinkedParam extends base.SummaryClass {
bool get isFinal;
/**
- * Indicates whether this is a function-typed parameter.
+ * Indicates whether this is a function-typed parameter. A parameter is
+ * function-typed if the declaration of the parameter has explicit formal
+ * parameters
+ * ```
+ * int functionTyped(int p)
+ * ```
+ * but is not function-typed if it does not, even if the type of the parameter
+ * is a function type.
*/
@Id(5)
bool get isFunctionTyped;
@@ -2886,12 +2925,19 @@ abstract class UnlinkedTypedef extends base.SummaryClass {
List<UnlinkedParam> get parameters;
/**
- * Return type of the typedef.
+ * If [isGenericFunctionType] is `false`, the return type of the typedef. If
+ * [isGenericFunctionType] is `true`, the function type being defined.
Brian Wilkerson 2017/02/28 20:28:49 Just noticed that this comment is out of date. Wil
*/
@Id(2)
EntityRef get returnType;
/**
+ * The style of the typedef.
+ */
+ @Id(8)
+ TypedefStyle get style;
+
+ /**
* Type parameters of the typedef, if any.
*/
@Id(5)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698