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

Issue 1488383004: Fixes incorrect generic function type capture (Closed)

Created:
5 years ago by Jennifer Messerly
Modified:
5 years 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 incorrect generic function type capture This improves how generic function types are modeled. In particular, we can now handle types like <T>T -> T, in printing, equality, and the type parameter is correctly removed when it is instantiated. This preserves the existing lazy "substitute" operation, and makes the "instantiate" operation interact with it correctly. Given a type like: {T/T}<S>T -> S we can substitute S/T to get: {S/T}<S>T -> S then if we instantiate as <int> we'll get the correct: {S/T, int/S}T -> S, which == S -> int This also converts typedefs over to the new system, as this seemed like the most natural thing. (However this does *not* change how the type name is evaluated, in particular given the type name "F", where "F" is a typedef `<T>T -> T`, will result in the function type `{dynamic/T}T->T` exactly as it did before. If we want to write the type `<T>T->T` we will need a different mechanism.) R=brianwilkerson@google.com, leafp@google.com Committed: https://github.com/dart-lang/sdk/commit/6cababc94c8b0c6c25c2cb10ee042bc29fc3f763

Patch Set 1 #

Patch Set 2 : #

Total comments: 12

Patch Set 3 : #

Patch Set 4 : #

Total comments: 8

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+275 lines, -92 lines) Patch
M pkg/analyzer/lib/src/generated/element.dart View 1 2 3 4 16 chunks +201 lines, -28 lines 0 comments Download
M pkg/analyzer/lib/src/generated/resolver.dart View 1 2 5 chunks +17 lines, -14 lines 0 comments Download
M pkg/analyzer/lib/src/generated/type_system.dart View 1 2 2 chunks +8 lines, -16 lines 0 comments Download
M pkg/analyzer/test/generated/resolver_test.dart View 1 2 3 4 4 chunks +49 lines, -34 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
Jennifer Messerly
5 years ago (2015-12-03 04:12:22 UTC) #3
Brian Wilkerson
LGTM https://codereview.chromium.org/1488383004/diff/20001/pkg/analyzer/lib/src/generated/element.dart File pkg/analyzer/lib/src/generated/element.dart (right): https://codereview.chromium.org/1488383004/diff/20001/pkg/analyzer/lib/src/generated/element.dart#newcode4589 pkg/analyzer/lib/src/generated/element.dart:4589: * Return the type resulting from instantiating the ...
5 years ago (2015-12-03 15:03:17 UTC) #4
Jennifer Messerly
Thanks Brian! https://codereview.chromium.org/1488383004/diff/20001/pkg/analyzer/lib/src/generated/element.dart File pkg/analyzer/lib/src/generated/element.dart (right): https://codereview.chromium.org/1488383004/diff/20001/pkg/analyzer/lib/src/generated/element.dart#newcode4589 pkg/analyzer/lib/src/generated/element.dart:4589: * Return the type resulting from instantiating ...
5 years ago (2015-12-03 17:35:04 UTC) #5
Brian Wilkerson
https://codereview.chromium.org/1488383004/diff/20001/pkg/analyzer/lib/src/generated/element.dart File pkg/analyzer/lib/src/generated/element.dart (right): https://codereview.chromium.org/1488383004/diff/20001/pkg/analyzer/lib/src/generated/element.dart#newcode4589 pkg/analyzer/lib/src/generated/element.dart:4589: * Return the type resulting from instantiating the given ...
5 years ago (2015-12-03 17:42:16 UTC) #6
Leaf
This is looking really great John. LGTM modulo the generalization of the free variable computation. ...
5 years ago (2015-12-03 18:46:35 UTC) #7
Jennifer Messerly
Thanks. I'll fix that toString issue and re-send https://codereview.chromium.org/1488383004/diff/60001/pkg/analyzer/lib/src/generated/element.dart File pkg/analyzer/lib/src/generated/element.dart (right): https://codereview.chromium.org/1488383004/diff/60001/pkg/analyzer/lib/src/generated/element.dart#newcode5218 pkg/analyzer/lib/src/generated/element.dart:5218: bool ...
5 years ago (2015-12-03 19:20:57 UTC) #8
Jennifer Messerly
PTAL. Fixed both printing issues. https://codereview.chromium.org/1488383004/diff/60001/pkg/analyzer/lib/src/generated/element.dart File pkg/analyzer/lib/src/generated/element.dart (right): https://codereview.chromium.org/1488383004/diff/60001/pkg/analyzer/lib/src/generated/element.dart#newcode5255 pkg/analyzer/lib/src/generated/element.dart:5255: for (DartType arg in ...
5 years ago (2015-12-03 22:48:07 UTC) #9
Leaf
Nice! lgtm.
5 years ago (2015-12-03 23:00:56 UTC) #10
Jennifer Messerly
5 years ago (2015-12-03 23:03:08 UTC) #12
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as
6cababc94c8b0c6c25c2cb10ee042bc29fc3f763 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698