sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[dart fix] Exceptions thrown during fixing

Open AlexV525 opened this issue 3 years ago • 2 comments

This tracker is for issues related to: Analyzer

PS X:\Coding\Garages\AstroxGarage\agent_dart> dart fix --apply lib
Computing fixes in lib...
Error from the analysis server: Exception while getting bulk fixes: Exception generating fix for sort_constructors_first in x:\coding\garages\astroxgarage\agent_dart\lib\bridge\ffi\ffi_bridge.dart
Null check operator used on a null value
#0      SortConstructorFirst.compute.<anonymous closure> (package:analysis_server/src/services/correction/dart/sort_constructor_first.dart:35:40)
#1      ChangeBuilderImpl.addDartFileEdit (package:analyzer_plugin/src/utilities/change_builder/change_builder_core.dart:144:20)
#2      SortConstructorFirst.compute (package:analysis_server/src/services/correction/dart/sort_constructor_first.dart:33:19)
#3      BulkFixProcessor._applyProducer (package:analysis_server/src/services/correction/bulk_fix_processor.dart:236:22)
#4      BulkFixProcessor._generateFix (package:analysis_server/src/services/correction/bulk_fix_processor.dart:401:11)
#5      BulkFixProcessor._fixSingleError.bulkApply (package:analysis_server/src/services/correction/bulk_fix_processor.dart:365:17)
#6      BulkFixProcessor._fixSingleError.bulkApply (package:analysis_server/src/services/correction/bulk_fix_processor.dart:360:27)
#7      BulkFixProcessor._fixSingleError (package:analysis_server/src/services/correction/bulk_fix_processor.dart:375:15)
#8      BulkFixProcessor._fixErrorsInLibrary (package:analysis_server/src/services/correction/bulk_fix_processor.dart:292:15)
<asynchronous suspension>
#9      BulkFixProcessor.fixErrors (package:analysis_server/src/services/correction/bulk_fix_processor.dart:176:11)
<asynchronous suspension>
#10     EditBulkFixes.handle (package:analysis_server/src/handler/legacy/edit_bulk_fixes.dart:48:27)
<asynchronous suspension>

#0      BulkFixProcessor._fixSingleError (package:analysis_server/src/services/correction/bulk_fix_processor.dart:391:7)
<asynchronous suspension>
#1      BulkFixProcessor._fixErrorsInLibrary (package:analysis_server/src/services/correction/bulk_fix_processor.dart:292:9)
<asynchronous suspension>
#2      BulkFixProcessor.fixErrors (package:analysis_server/src/services/correction/bulk_fix_processor.dart:176:11)
<asynchronous suspension>
#3      EditBulkFixes.handle (package:analysis_server/src/handler/legacy/edit_bulk_fixes.dart:48:27)
<asynchronous suspension>

The original file for fix: ffi_bridge.dart.txt Or you can use the repo with 1982da6 to reproduce.

AlexV525 avatar Sep 16 '22 07:09 AlexV525

I can't reproduce with Dart SDK version: 2.19.0-183.0.dev (dev) (Fri Sep 9 08:47:43 2022 -0700) on "windows_x64", please specify which version was used to produce that error.

C:\use\agent_dart-1982da6e940ed8edbf5e6b661328d6e2e56625d4>dart fix --apply lib
Computing fixes in lib...
Applying fixes...

agent\agent\http\index.dart
  unnecessary_cast • 2 fixes

bridge\ffi\ffi_bridge.dart
  require_trailing_commas • 114 fixes
  sort_constructors_first • 22 fixes

138 fixes made in 2 files.

asashour avatar Sep 16 '22 16:09 asashour

I'm at 2.17.6 (stable) (not upgraded to Flutter 3.3), will check later if the new stable 2.18.x can reproduce this.

AlexV525 avatar Sep 16 '22 19:09 AlexV525

Doesn't seem to be reproducible on 2.18.0. Closing. Thanks!

AlexV525 avatar Oct 20 '22 17:10 AlexV525