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

Issue 1720433002: fixes #25477, downward inference of generic methods (Closed)

Created:
4 years, 10 months ago by Jennifer Messerly
Modified:
4 years, 10 months ago
Reviewers:
Leaf, Brian Wilkerson
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

fixes #25477, downward inference of generic methods * we now push the context return type down when inferring * we also take this into account in our initial downards inference for arguments * adds a common AST interface for FunctionExpressionInvocation and MethodInvocation, so we can handle these more uniformly R=brianwilkerson@google.com, leafp@google.com Committed: https://github.com/dart-lang/sdk/commit/0c4e64c8efafd9ac6d8fd004706ee69639b0d04f

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : fix breakage caused by refactoring #

Total comments: 8

Patch Set 5 : #

Total comments: 17

Patch Set 6 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+253 lines, -208 lines) Patch
M pkg/analyzer/lib/dart/ast/ast.dart View 1 2 3 4 5 9 chunks +59 lines, -26 lines 2 comments Download
M pkg/analyzer/lib/src/dart/ast/ast.dart View 1 2 3 4 5 11 chunks +59 lines, -92 lines 0 comments Download
M pkg/analyzer/lib/src/generated/resolver.dart View 1 2 3 4 5 2 chunks +21 lines, -4 lines 0 comments Download
M pkg/analyzer/lib/src/generated/static_type_analyzer.dart View 1 2 3 4 5 5 chunks +32 lines, -72 lines 0 comments Download
M pkg/analyzer/lib/src/generated/type_system.dart View 3 chunks +8 lines, -3 lines 0 comments Download
M pkg/analyzer/test/generated/type_system_test.dart View 1 2 3 3 chunks +26 lines, -4 lines 0 comments Download
M pkg/analyzer/test/src/task/strong/checker_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M pkg/analyzer/test/src/task/strong/inferred_type_test.dart View 1 2 3 4 5 3 chunks +44 lines, -3 lines 0 comments Download

Messages

Total messages: 14 (2 generated)
Jennifer Messerly
4 years, 10 months ago (2016-02-19 20:30:36 UTC) #2
Jennifer Messerly
In case it's not apparent, there's two stages to the inference. Given something like: class ...
4 years, 10 months ago (2016-02-19 21:09:52 UTC) #3
Jennifer Messerly
On 2016/02/19 21:09:52, John Messerly wrote: > In case it's not apparent, there's two stages ...
4 years, 10 months ago (2016-02-19 21:21:08 UTC) #4
Leaf
lgtm. I think I would like to see us recording the generic type argument inferences ...
4 years, 10 months ago (2016-02-19 23:19:04 UTC) #5
Jennifer Messerly
Thanks Leaf! I'll give Brian a chance to take a look too, at the new ...
4 years, 10 months ago (2016-02-20 01:14:12 UTC) #6
Jennifer Messerly
Hey Brian, if you're around, figured you might want to take a look at the ...
4 years, 10 months ago (2016-02-22 21:22:52 UTC) #7
Brian Wilkerson
LGTM, but the files need to be sorted. Yes, fields sort before getters/setters, but "p" ...
4 years, 10 months ago (2016-02-22 22:13:26 UTC) #8
Jennifer Messerly
On 2016/02/22 22:13:26, Brian Wilkerson wrote: > LGTM, but the files need to be sorted. ...
4 years, 10 months ago (2016-02-22 22:23:45 UTC) #9
Jennifer Messerly
Thanks! All requested changes were made. Great idea on using "function" name. https://codereview.chromium.org/1720433002/diff/80001/pkg/analyzer/lib/dart/ast/ast.dart File pkg/analyzer/lib/dart/ast/ast.dart ...
4 years, 10 months ago (2016-02-22 22:45:55 UTC) #10
Jennifer Messerly
Committed patchset #6 (id:100001) manually as 0c4e64c8efafd9ac6d8fd004706ee69639b0d04f (presubmit successful).
4 years, 10 months ago (2016-02-22 22:48:45 UTC) #12
Brian Wilkerson
LGTM https://codereview.chromium.org/1720433002/diff/100001/pkg/analyzer/lib/dart/ast/ast.dart File pkg/analyzer/lib/dart/ast/ast.dart (right): https://codereview.chromium.org/1720433002/diff/100001/pkg/analyzer/lib/dart/ast/ast.dart#newcode4985 pkg/analyzer/lib/dart/ast/ast.dart:4985: DartType propagatedInvokeType; I'd forgotten that we decided to ...
4 years, 10 months ago (2016-02-22 22:50:52 UTC) #13
Jennifer Messerly
4 years, 10 months ago (2016-02-22 22:58:40 UTC) #14
Message was sent while issue was closed.
https://codereview.chromium.org/1720433002/diff/100001/pkg/analyzer/lib/dart/...
File pkg/analyzer/lib/dart/ast/ast.dart (right):

https://codereview.chromium.org/1720433002/diff/100001/pkg/analyzer/lib/dart/...
pkg/analyzer/lib/dart/ast/ast.dart:4985: DartType propagatedInvokeType;
On 2016/02/22 22:50:52, Brian Wilkerson wrote:
> I'd forgotten that we decided to not sort fields (because sometimes fields are
> grouped for semantic purposes). But if we make these getters instead of
fields,
> that problem goes away :-)

yeah I can do that. I'll send you a CL.

I was mainly hoping to avoid yet more doc comment expansion ... "Return the
function type of the invocation ... <paragraph>"

"Sets the function type of the invocation ... <paragraph>"

Powered by Google App Engine
This is Rietveld 408576698