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

Unified Diff: pkg/analyzer/lib/dart/ast/ast.dart

Issue 1720433002: fixes #25477, downward inference of generic methods (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | pkg/analyzer/lib/src/dart/ast/ast.dart » ('j') | pkg/analyzer/lib/src/dart/ast/ast.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/dart/ast/ast.dart
diff --git a/pkg/analyzer/lib/dart/ast/ast.dart b/pkg/analyzer/lib/dart/ast/ast.dart
index 598d6116c181de35f372ced023f6d874991cd3c9..0492742bd4eaafcc9d94c3bc47eef945426055d6 100644
--- a/pkg/analyzer/lib/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/dart/ast/ast.dart
@@ -536,7 +536,7 @@ abstract class AstNode {
* (either AST nodes or tokens) that make up the contents of this node,
* including doc comments but excluding other comments.
*/
- Iterable /*<AstNode | Token>*/ get childEntities;
+ Iterable/*<AstNode | Token>*/ get childEntities;
/**
* Return the offset of the character immediately following the last character
@@ -591,7 +591,7 @@ abstract class AstNode {
* Use the given [visitor] to visit this node. Return the value returned by
* the visitor as a result of visiting this node.
*/
- dynamic /* =E */ accept /*<E>*/ (AstVisitor /*<E>*/ visitor);
+ dynamic /* =E */ accept/*<E>*/(AstVisitor/*<E>*/ visitor);
/**
* Return the most immediate ancestor of this node for which the [predicate]
@@ -3994,7 +3994,7 @@ abstract class FunctionExpression extends Expression {
*
* Clients may not extend, implement or mix-in this class.
*/
-abstract class FunctionExpressionInvocation extends Expression {
+abstract class FunctionExpressionInvocation extends InvocationExpression {
/**
* Initialize a newly created function expression invocation.
*/
@@ -4978,6 +4978,61 @@ abstract class InterpolationString extends InterpolationElement {
}
/**
+ * Common interface for [FunctionExpressionInvocation] and [MethodInvocation].
Brian Wilkerson 2016/02/22 22:13:25 nit: "Common interface for" --> "The invocation of
Jennifer Messerly 2016/02/22 22:45:55 Done.
+ */
+abstract class InvocationExpression extends Expression {
+ /**
+ * The function type of the method invocation, or `null` if the AST
Brian Wilkerson 2016/02/22 22:13:25 nit: "The function type of the method invocation"
Jennifer Messerly 2016/02/22 22:45:55 Done. but, FYI, this comment already existed, code
+ * structure has not been resolved, or if the invoke could not be resolved.
+ *
+ * This will usually be a [FunctionType], but it can also be an
+ * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy`
+ * interface type that implements `Function`.
+ */
+ DartType staticInvokeType;
Brian Wilkerson 2016/02/22 22:13:25 I have used only getter and setters in the public
+
+ /**
+ * Like [staticInvokeType], but reflects propagated type information.
Brian Wilkerson 2016/02/22 22:13:25 nit: I'd prefer the full documentation here becaus
Jennifer Messerly 2016/02/22 22:45:55 Done. But in general: I very strongly prefer to a
+ */
+ DartType propagatedInvokeType;
+
+ /**
+ * Return the list of arguments to the method.
+ */
+ ArgumentList get argumentList;
+
+ /**
+ * Set the list of arguments to the method to the given [argumentList].
+ */
+ void set argumentList(ArgumentList argumentList);
Brian Wilkerson 2016/02/22 22:13:25 Do we need this setter to be defined here, or are
Jennifer Messerly 2016/02/22 22:45:55 Okay, moved setters back down.
+
+ /**
+ * The target of the invocation node. For example:
+ *
+ * (o.m)<TArgs>(args); // target will be `o.m`
+ * o.m<TArgs>(args); // target will be `m`
+ *
+ * In either case, the [invocationTarget.staticType] will be the
+ * [staticInvokeType] before applying type arguments `TArgs`. Similarly,
+ * [invocationTarget.propagatedType] will be the [propagatedInvokeType]
+ * before applying type arguments `TArgs`.
+ */
+ Expression get invocationTarget;
Brian Wilkerson 2016/02/22 22:13:25 I was a bit confused when I first read the comment
Jennifer Messerly 2016/02/22 22:45:55 Nice, yeah "function" is a good idea. Done. (& upd
+
+ /**
+ * Return the type arguments to be applied to the method being invoked, or
+ * `null` if no type arguments were provided.
+ */
+ TypeArgumentList get typeArguments;
+
+ /**
+ * Set the type arguments to be applied to the method being invoked to the
+ * given [typeArguments].
+ */
+ void set typeArguments(TypeArgumentList typeArguments);
Brian Wilkerson 2016/02/22 22:13:25 Do we need this?
Jennifer Messerly 2016/02/22 22:45:55 Done, moved down to subclasses.
+}
+
+/**
* An is expression.
*
* > isExpression ::=
@@ -5519,7 +5574,7 @@ abstract class MethodDeclaration extends ClassMember {
*
* Clients may not extend, implement or mix-in this class.
*/
-abstract class MethodInvocation extends Expression {
+abstract class MethodInvocation extends InvocationExpression {
/**
* Initialize a newly created method invocation. The [target] and [operator]
* can be `null` if there is no target.
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/ast/ast.dart » ('j') | pkg/analyzer/lib/src/dart/ast/ast.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698