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

Issue 3012593002: Add a hint on static uses of fuzzy arrows. (Closed)

Created:
3 years, 3 months ago by Leaf
Modified:
3 years, 3 months ago
CC:
reviews_dartlang.org, dart-uxr+reviews_google.com, Brian Wilkerson
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add a hint on static uses of fuzzy arrows. This causes the analyzer to emit a hint message when fuzzy arrow subtyping is used. BUG= R=brianwilkerson@google.com Committed: https://github.com/dart-lang/sdk/commit/1f7c0d2c4c511956cacb72d528372c7cabb2ac1e

Patch Set 1 #

Patch Set 2 : Tweak #

Patch Set 3 : Increment DATA_VERSION #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -15 lines) Patch
M pkg/analyzer/lib/error/error.dart View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/analyzer/lib/src/dart/analysis/driver.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M pkg/analyzer/lib/src/dart/error/hint_codes.dart View 1 chunk +12 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/generated/type_system.dart View 10 chunks +17 lines, -5 lines 0 comments Download
M pkg/analyzer/lib/src/task/strong/checker.dart View 1 3 chunks +22 lines, -1 line 2 comments Download
M pkg/analyzer/test/src/task/strong/checker_test.dart View 6 chunks +8 lines, -8 lines 0 comments Download

Messages

Total messages: 10 (3 generated)
Leaf
3 years, 3 months ago (2017-08-30 21:55:01 UTC) #2
Brian Wilkerson
This also needs to increment the value of the field AnalysisDriver.DATA_VERSION (in pkg/analyzer/lib/src/dart/analysis/driver.dart). Other than ...
3 years, 3 months ago (2017-08-30 22:04:03 UTC) #4
Leaf
On 2017/08/30 22:04:03, Brian Wilkerson wrote: > This also needs to increment the value of ...
3 years, 3 months ago (2017-08-30 22:19:47 UTC) #5
Leaf
Committed patchset #3 (id:40001) manually as 1f7c0d2c4c511956cacb72d528372c7cabb2ac1e (presubmit successful).
3 years, 3 months ago (2017-08-30 22:27:34 UTC) #7
Jennifer Messerly
oh nice! I've got a suggestion on how to simplify so we don't need any ...
3 years, 3 months ago (2017-08-30 23:29:48 UTC) #8
Leaf
On 2017/08/30 23:29:48, Jennifer Messerly wrote: > oh nice! I've got a suggestion on how ...
3 years, 3 months ago (2017-08-30 23:40:18 UTC) #9
karlklose
3 years, 3 months ago (2017-08-31 06:29:16 UTC) #10
Message was sent while issue was closed.
On 2017/08/30 23:40:18, Leaf wrote:
> On 2017/08/30 23:29:48, Jennifer Messerly wrote:
> > oh nice! I've got a suggestion on how to simplify so we don't need any
changes
> > in type_system.dart
> > 
> >
>
https://codereview.chromium.org/3012593002/diff/40001/pkg/analyzer/lib/src/ta...
> > File pkg/analyzer/lib/src/task/strong/checker.dart (right):
> > 
> >
>
https://codereview.chromium.org/3012593002/diff/40001/pkg/analyzer/lib/src/ta...
> > pkg/analyzer/lib/src/task/strong/checker.dart:1081: from ??=
> > _getDefiniteType(expr);
> > this is not needed because `_checkImplicitCast` did this before this
function
> > was called
> > 
> > Also the `expr` parameter is not necessary.
> > 
> >
>
https://codereview.chromium.org/3012593002/diff/40001/pkg/analyzer/lib/src/ta...
> > pkg/analyzer/lib/src/task/strong/checker.dart:1085: if
> (rules.isSubtypeOf(from,
> > to)) {
> > alternate way to implement this method that may be simpler:
> > 
> > // If it is a subtype with fuzzy arrows on,
> > / check to see if it still is with them off.
> > if (rules.isSubtypeOf(from, to)) {
> >   // Remove fuzzy arrows
> >   var cFrom = rules.typeToConcreteType(from);
> >   var cTo = rules.typeToConcreteType(to);
> >   // If still true, no warning needed
> >   if (rules.isSubtypeOf(cFrom, cTo)) return;
> >   _recordMessage(expr, HintCode.USES_DYNAMIC_AS_BOTTOM, [from, to]);
> > }
> 
> Good suggestions, thanks.  I'll follow up with another CL.

This change added a lot of warnings to pkg/kernel, pkg/analysis_server,
pkg/compiler, and pkg/front_end, which broke
pkg/front_end/test/fasta/analyze_test.

Run python tools/test.py -m release --checked
pkg/front_end/test/fasta/analyze_test on this CL to reproduce.

Powered by Google App Engine
This is Rietveld 408576698