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

Issue 3002773002: fix #30462, update function_type tests to understand covariant generics (Closed)

Created:
3 years, 4 months ago by Jennifer Messerly
Modified:
3 years, 4 months ago
Reviewers:
Leaf, floitsch
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

fix #30462, update function_type tests to understand covariant generics In particular, the reified type of method tear-offs may substitute Object for the class type parameter. This is done when the parameter needs a covariance check. The test generator is updated to understand this distinction. R=floitsch@google.com Committed: https://github.com/dart-lang/sdk/commit/2ea6a5dd5cd389db00479ea41c74241ff8336ea4

Patch Set 1 #

Patch Set 2 : simplify diff #

Total comments: 11

Patch Set 3 : style: use ?? false rather than == true #

Unified diffs Side-by-side diffs Delta from patch set Stats (+348 lines, -375 lines) Patch
M tests/language_2/function_type/function_type0_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type10_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type12_test.dart View 2 chunks +8 lines, -8 lines 0 comments Download
M tests/language_2/function_type/function_type13_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type14_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type15_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type16_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type17_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type18_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type19_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type1_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type20_test.dart View 2 chunks +8 lines, -8 lines 0 comments Download
M tests/language_2/function_type/function_type21_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type22_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type24_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type25_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type26_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type27_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type28_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type29_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type2_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type30_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type31_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type32_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type33_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type34_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type36_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type3_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type44_test.dart View 2 chunks +8 lines, -8 lines 0 comments Download
M tests/language_2/function_type/function_type45_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type46_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type47_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type48_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type49_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type4_test.dart View 2 chunks +8 lines, -8 lines 0 comments Download
M tests/language_2/function_type/function_type50_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type51_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type52_test.dart View 2 chunks +8 lines, -8 lines 0 comments Download
M tests/language_2/function_type/function_type53_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type54_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type56_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type57_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type58_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type59_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type5_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type60_test.dart View 2 chunks +8 lines, -8 lines 0 comments Download
M tests/language_2/function_type/function_type61_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type62_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type63_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type64_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type65_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type66_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type6_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type7_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type80_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type81_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type82_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type83_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type84_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type85_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type86_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type87_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type88_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type89_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type8_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type90_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type96_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/function_type9_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/language_2/function_type/test_generator.dart View 1 2 9 chunks +52 lines, -13 lines 0 comments Download
M tests/language_2/language_2_dartdevc.status View 1 chunk +0 lines, -66 lines 0 comments Download

Messages

Total messages: 7 (3 generated)
Jennifer Messerly
3 years, 4 months ago (2017-08-17 06:40:15 UTC) #3
floitsch
Good catch. Thanks for fixing the generator. LGTM. https://codereview.chromium.org/3002773002/diff/20001/tests/language_2/function_type/test_generator.dart File tests/language_2/function_type/test_generator.dart (right): https://codereview.chromium.org/3002773002/diff/20001/tests/language_2/function_type/test_generator.dart#newcode316 tests/language_2/function_type/test_generator.dart:316: .any((l) ...
3 years, 4 months ago (2017-08-17 07:48:45 UTC) #4
Jennifer Messerly
Committed patchset #3 (id:40001) manually as 2ea6a5dd5cd389db00479ea41c74241ff8336ea4 (presubmit successful).
3 years, 4 months ago (2017-08-17 20:00:43 UTC) #6
Jennifer Messerly
3 years, 4 months ago (2017-08-17 23:44:20 UTC) #7
Message was sent while issue was closed.
(oops, forgot to hit send on my comments)

https://codereview.chromium.org/3002773002/diff/20001/tests/language_2/functi...
File tests/language_2/function_type/test_generator.dart (right):

https://codereview.chromium.org/3002773002/diff/20001/tests/language_2/functi...
tests/language_2/function_type/test_generator.dart:309: return returnType?.usesT
== true ||
fixed this too (per comment below)

https://codereview.chromium.org/3002773002/diff/20001/tests/language_2/functi...
tests/language_2/function_type/test_generator.dart:316: .any((l) => l?.any((p)
=> p.takesT) == true);
On 2017/08/17 07:48:44, floitsch wrote:
> use ?? false.
> 
> This makes it clear, that you have to worry about `null`.

Oh nice! I was trying to match the style of `get usesT` above, but I really like
this suggestion. I'll fix all of them to be consistent with ?? false style.

https://codereview.chromium.org/3002773002/diff/20001/tests/language_2/functi...
tests/language_2/function_type/test_generator.dart:322: .any((l) => l?.any((p)
=> p.returnsT) == true);
On 2017/08/17 07:48:45, floitsch wrote:
> ditto.

Done.

https://codereview.chromium.org/3002773002/diff/20001/tests/language_2/functi...
tests/language_2/function_type/test_generator.dart:326: return returnType?.usesT
== true || returnsT;
On 2017/08/17 07:48:45, floitsch wrote:
> return returnType?.usesT ?? returnsT;

Done.

https://codereview.chromium.org/3002773002/diff/20001/tests/language_2/functi...
tests/language_2/function_type/test_generator.dart:369: bool get returnsT =>
name == "T" || generic?.any((t) => t.returnsT) == true;
On 2017/08/17 07:48:44, floitsch wrote:
> ditto.

Done.

https://codereview.chromium.org/3002773002/diff/20001/tests/language_2/functi...
tests/language_2/function_type/test_generator.dart:371: bool get takesT =>
generic?.any((t) => t.takesT) == true;
On 2017/08/17 07:48:45, floitsch wrote:
> ditto.

Done.

Powered by Google App Engine
This is Rietveld 408576698