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

Issue 1678313002: fix part of #25200, reject non-generic function subtype of generic function (Closed)

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

Description

fix part of #25200, we now reject non-generic fn subtype of generic fn A few other fixes: * inference of generic function expressions now works. It was broken because they ignored type parameters. * fixes subtype of generic functions in the "normal" type system. These types are only possible if generic methods support is enabled, which can be accessed via a flag. The generic methods DEP is designed to work with the normal Dart type system, too, so we try to keep these code paths working. ("normal" type equality for function types already handled this correctly.) This is also needed because strong mode delegates to normal type system for some cases, e.g. to pick warning vs error. * also refactors structural comparison of two generic function types, along the lines of recent changes, so there is less code duplication. This was my original motivation, but reviewing the code led to the discovery of the other issues. * refactors strong_test_helper. The existing way of matching up errors did not work with generic function expressions like: /*<T>*/(x) => x. Simplified it to just look for the right offset. This also exposed a bug in a test -- previously, it was possible to have an error that wasn't validated. R=leafp@google.com, rnystrom@google.com Committed: https://github.com/dart-lang/sdk/commit/f97640745e533b47fe9208f4724b0ab5b9230dc9

Patch Set 1 #

Total comments: 40

Patch Set 2 : #

Patch Set 3 : fix synthetic ctor #

Unified diffs Side-by-side diffs Delta from patch set Stats (+472 lines, -319 lines) Patch
M pkg/analyzer/lib/src/dart/element/element.dart View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/dart/element/type.dart View 1 5 chunks +101 lines, -61 lines 0 comments Download
M pkg/analyzer/lib/src/generated/resolver.dart View 1 2 chunks +52 lines, -6 lines 0 comments Download
M pkg/analyzer/lib/src/generated/static_type_analyzer.dart View 1 chunk +10 lines, -5 lines 0 comments Download
M pkg/analyzer/lib/src/generated/type_system.dart View 1 6 chunks +41 lines, -116 lines 0 comments Download
M pkg/analyzer/test/src/task/strong/checker_test.dart View 2 chunks +43 lines, -8 lines 0 comments Download
M pkg/analyzer/test/src/task/strong/inferred_type_test.dart View 3 chunks +84 lines, -6 lines 0 comments Download
M pkg/analyzer/test/src/task/strong/strong_test_helper.dart View 13 chunks +133 lines, -117 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
Jennifer Messerly
Hey everyone, here's a working version of this CL now. Feel free to comment on ...
4 years, 10 months ago (2016-02-08 21:38:58 UTC) #3
Jennifer Messerly
A few comments to help review. https://codereview.chromium.org/1678313002/diff/1/pkg/analyzer/lib/src/generated/resolver.dart File pkg/analyzer/lib/src/generated/resolver.dart (right): https://codereview.chromium.org/1678313002/diff/1/pkg/analyzer/lib/src/generated/resolver.dart#newcode7305 pkg/analyzer/lib/src/generated/resolver.dart:7305: FunctionType matchFunctionTypeParameters( I ...
4 years, 10 months ago (2016-02-08 21:54:27 UTC) #4
Bob Nystrom
LGTM. https://codereview.chromium.org/1678313002/diff/1/pkg/analyzer/lib/src/dart/element/type.dart File pkg/analyzer/lib/src/dart/element/type.dart (right): https://codereview.chromium.org/1678313002/diff/1/pkg/analyzer/lib/src/dart/element/type.dart#newcode740 pkg/analyzer/lib/src/dart/element/type.dart:740: * Writing nit: It's easy to get into ...
4 years, 10 months ago (2016-02-09 01:25:18 UTC) #5
Leaf
https://codereview.chromium.org/1678313002/diff/1/pkg/analyzer/lib/src/dart/element/type.dart File pkg/analyzer/lib/src/dart/element/type.dart (right): https://codereview.chromium.org/1678313002/diff/1/pkg/analyzer/lib/src/dart/element/type.dart#newcode703 pkg/analyzer/lib/src/dart/element/type.dart:703: Why does this ignore the generic case? If just ...
4 years, 10 months ago (2016-02-09 21:29:25 UTC) #6
Jennifer Messerly
Hey Leaf & Bob! thanks for comments, think I got them all. Let me know ...
4 years, 10 months ago (2016-02-10 22:42:08 UTC) #7
Jennifer Messerly
p.s. it'd probably be good to reach a fixed point on this refactoring ... I ...
4 years, 10 months ago (2016-02-10 22:43:25 UTC) #8
Leaf
lgtm, thanks!
4 years, 10 months ago (2016-02-11 01:00:53 UTC) #9
Jennifer Messerly
4 years, 10 months ago (2016-02-11 21:42:54 UTC) #11
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
f97640745e533b47fe9208f4724b0ab5b9230dc9 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698