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

Issue 1863103002: Add an UNUSED_SHOWN_NAMES hint to the analyzer (Closed)

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

Description

Add an UNUSED_SHOWN_NAMES hint to the analyzer BUG=https://github.com/dart-lang/sdk/issues/21030 R=brianwilkerson@google.com, scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/c1963b3995765dc8c4a5a90a3d01dac079552bf0

Patch Set 1 #

Total comments: 14

Patch Set 2 : Addressing comments #

Patch Set 3 : Fix top-level variables #

Unified diffs Side-by-side diffs Delta from patch set Stats (+253 lines, -65 lines) Patch
M pkg/analyzer/lib/src/generated/error.dart View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/generated/resolver.dart View 1 2 13 chunks +163 lines, -63 lines 0 comments Download
M pkg/analyzer/lib/src/task/dart.dart View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/analyzer/test/generated/hint_code_test.dart View 1 2 1 chunk +76 lines, -0 lines 0 comments Download
M pkg/analyzer/test/generated/non_error_resolver_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/analyzer/test/src/summary/resynthesize_test.dart View 1 2 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 12 (3 generated)
srawlins
Hi Konstantin, I see you're the most active on the analyzer, but please redirect this ...
4 years, 8 months ago (2016-04-06 14:56:32 UTC) #2
Brian Wilkerson
lgtm https://codereview.chromium.org/1863103002/diff/1/pkg/analyzer/lib/src/generated/error.dart File pkg/analyzer/lib/src/generated/error.dart (right): https://codereview.chromium.org/1863103002/diff/1/pkg/analyzer/lib/src/generated/error.dart#newcode3785 pkg/analyzer/lib/src/generated/error.dart:3785: const HintCode('UNUSED_SHOWN_NAME', "Unused name shown in import"); The ...
4 years, 8 months ago (2016-04-06 15:17:40 UTC) #4
scheglov
DBC https://codereview.chromium.org/1863103002/diff/1/pkg/analyzer/lib/src/generated/resolver.dart File pkg/analyzer/lib/src/generated/resolver.dart (right): https://codereview.chromium.org/1863103002/diff/1/pkg/analyzer/lib/src/generated/resolver.dart#newcode4734 pkg/analyzer/lib/src/generated/resolver.dart:4734: List<SimpleIdentifier> list = _unusedShownNamesMap[importDirective]; Could you use a ...
4 years, 8 months ago (2016-04-06 15:34:39 UTC) #5
srawlins
Thanks for the review! Everything's updated! https://codereview.chromium.org/1863103002/diff/1/pkg/analyzer/lib/src/generated/error.dart File pkg/analyzer/lib/src/generated/error.dart (right): https://codereview.chromium.org/1863103002/diff/1/pkg/analyzer/lib/src/generated/error.dart#newcode3785 pkg/analyzer/lib/src/generated/error.dart:3785: const HintCode('UNUSED_SHOWN_NAME', "Unused ...
4 years, 8 months ago (2016-04-07 15:27:23 UTC) #6
scheglov
LGTM
4 years, 8 months ago (2016-04-07 16:26:15 UTC) #7
Brian Wilkerson
lgtm
4 years, 8 months ago (2016-04-07 16:30:08 UTC) #8
srawlins
I ran a performance analysis. Results here: https://gist.github.com/srawlins/684659c7d7aec389d54c5e517a904f17 TL;DR this new analysis costs less than ...
4 years, 8 months ago (2016-04-08 18:41:45 UTC) #9
srawlins
Committed patchset #3 (id:40001) manually as c1963b3995765dc8c4a5a90a3d01dac079552bf0 (presubmit successful).
4 years, 8 months ago (2016-04-08 18:44:41 UTC) #11
Paul Berry
4 years, 8 months ago (2016-04-08 21:00:58 UTC) #12
Message was sent while issue was closed.
On 2016/04/08 18:44:41, srawlins wrote:
> Committed patchset #3 (id:40001) manually as
> c1963b3995765dc8c4a5a90a3d01dac079552bf0 (presubmit successful).

It looks like this CL caused a unit test failure in analyzer.

Repro with: python tools/test.py -aia32 --checked -mrelease -t60
pkg/analyzer/test/generated/non_hint_code_test

Sample output:

FAIL: NonHintCodeTest | test_unusedImport_prefix_topLevelFunction
  Expected 0 errors of type HintCode.UNUSED_SHOWN_NAME, found 1 (84)
  package:unittest/src/simple_configuration.dart 128:34      
SimpleConfiguration.onExpectFailure
  package:unittest/src/simple_configuration.dart 24:13       
_ExpectFailureHandler.fail
  package:unittest/src/matcher/expect.dart 103:18             fail
  pkg/analyzer/test/generated/test_support.dart 330:7        
GatheringErrorListener.assertErrorsWithCodes
  pkg/analyzer/test/generated/resolver_test_case.dart 387:19 
ResolverTestCase.assertErrors
  pkg/analyzer/test/generated/resolver_test_case.dart 422:5  
ResolverTestCase.assertNoErrors
  pkg/analyzer/test/generated/non_hint_code_test.dart 1095:5 
NonHintCodeTest.test_unusedImport_prefix_topLevelFunction
  dart:mirrors-patch/mirrors_impl.dart 533                   
_LocalInstanceMirror._invoke
  dart:mirrors-patch/mirrors_impl.dart 529                   
_LocalInstanceMirror.invoke
  pkg/analyzer/test/reflective_tests.dart 128:35              _runTest.<fn>
  dart:async/zone.dart 902                                    _rootRunUnary
  dart:async/zone.dart 798                                   
_CustomZone.runUnary
  dart:async/future_impl.dart 553                            
_Future._propagateToListeners.handleValueCallback
  dart:async/future_impl.dart 639                            
_Future._propagateToListeners
  dart:async/future_impl.dart 426                            
_Future._completeWithValue
  dart:async/future_impl.dart 481                            
_Future._asyncComplete.<fn>
  dart:async/zone.dart 895                                    _rootRun
  dart:async/zone.dart 790                                    _CustomZone.run
  dart:async/zone.dart 696                                   
_CustomZone.runGuarded
  dart:async/zone.dart 721                                   
_CustomZone.bindCallback.<fn>
  dart:async/schedule_microtask.dart 41                       _microtaskLoop
  dart:async/schedule_microtask.dart 50                      
_startMicrotaskLoop
  dart:isolate-patch/isolate_patch.dart 96                   
_runPendingImmediateCallback
  dart:isolate-patch/isolate_patch.dart 149                  
_RawReceivePortImpl._handleMessage

Would you mind having a look?

Powered by Google App Engine
This is Rietveld 408576698