Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dartanalyzer exception: RangeError #893

Closed
pblinux opened this issue May 29, 2021 · 3 comments
Closed

dartanalyzer exception: RangeError #893

pblinux opened this issue May 29, 2021 · 3 comments

Comments

@pblinux
Copy link

pblinux commented May 29, 2021

Hello.

One of my packages got the score reduced for static analysis.

The output of the error:
dartanalyzer exception: RangeError (index): Invalid value: Not in inclusive range 0..12: 13

But when dartanalyzer . is executed local, there is no output related to the error mentioned in the score.

Running pana . local got this output:

INFO       Running `/Users/pblinux/.flutter/bin/cache/dart-sdk/bin/dartanalyzer --options /Users/pblinux/Projects/Personal/Dart/common_bloc/pana_analysis_options_1622313679330896.g.yaml --format machine lib`...
SEVERE     Bad input?: Unhandled exception:
           RangeError (index): Invalid value: Not in inclusive range 0..12: 13
           #0      List.[] (dart:core-patch/array.dart:268:52)
           #1      BestPracticesVerifier._targetKindsFor (package:analyzer/src/error/best_practices_verifier.dart:1601:38)
           #2      BestPracticesVerifier.visitAnnotation (package:analyzer/src/error/best_practices_verifier.dart:253:17)
           #3      AnnotationImpl.accept (package:analyzer/src/dart/ast/ast.dart:302:50)
           #4      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7517:20)
           #5      AnnotatedNodeImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:145:17)
           #6      MethodDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:6946:11)
           #7      RecursiveAstVisitor.visitMethodDeclaration (package:analyzer/dart/ast/visitor.dart:1071:10)
           #8      BestPracticesVerifier.visitMethodDeclaration (package:analyzer/src/error/best_practices_verifier.dart:588:13)
           #9      MethodDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:6942:50)
           #10     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7517:20)
           #11     MixinDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:7199:13)
           #12     RecursiveAstVisitor.visitMixinDeclaration (package:analyzer/dart/ast/visitor.dart:1083:10)
           #13     BestPracticesVerifier.visitMixinDeclaration (package:analyzer/src/error/best_practices_verifier.dart:614:13)
           #14     MixinDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7190:50)
           #15     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7517:20)
           #16     CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:2112:21)
           #17     RecursiveAstVisitor.visitCompilationUnit (package:analyzer/dart/ast/visitor.dart:735:10)
           #18     CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2105:50)
           #19     LibraryAnalyzer._computeHints (package:analyzer/src/dart/analysis/library_analyzer.dart:276:10)
           #20     LibraryAnalyzer.analyzeSync.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:158:9)
           #21     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:397:8)
           #22     LibraryAnalyzer.analyzeSync (package:analyzer/src/dart/analysis/library_analyzer.dart:157:13)
           #23     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:104:12)
           #24     AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1315:63)
           #25     PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:32:15)
           #26     AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1286:20)
           #27     AnalysisDriver._computeErrors (package:analyzer/src/dart/analysis/driver.dart:1369:26)
           #28     AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:987:20)
           #29     AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2006:24)
           <asynchronous suspension>
           
           #0      AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1344:9)
           #1      PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:32:15)
           #2      AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1286:20)
           #3      AnalysisDriver._computeErrors (package:analyzer/src/dart/analysis/driver.dart:1369:26)
           #4      AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:987:20)
           #5      AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2006:24)

Working with:

> dart --version
Dart SDK version: 2.13.1 (stable) (Fri May 21 12:45:36 2021 +0200) on "macos_x64"

Maybe related to #892?

@pblinux
Copy link
Author

pblinux commented May 31, 2021

Adding analyzer: ˆ1.7.1 as dependency seems to "fix it" 🤔

@isoos
Copy link
Collaborator

isoos commented May 31, 2021

Adding analyzer: ˆ1.7.1 as dependency seems to "fix it" 🤔

Confirmed, that's really strange.
I think I'll hijack dart-lang/sdk#46183 to include this too.

@isoos
Copy link
Collaborator

isoos commented Jul 19, 2021

This has been fixed on pub.dev

@isoos isoos closed this as completed Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants