Chromium Code Reviews| 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) |