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

parameter_assignments crashes #334

Closed
dikmax opened this issue Nov 17, 2016 · 12 comments
Closed

parameter_assignments crashes #334

dikmax opened this issue Nov 17, 2016 · 12 comments
Assignees

Comments

@dikmax
Copy link
Contributor

dikmax commented Nov 17, 2016

Dart 1.20.1
Linter 0.1.29

Stack track:

Unhandled exception:
AnalysisException: Cannot compute DART_ERRORS for /Users/maksimdzikun/workspace/md_proc/lib/definitions.dart
Caused by Unexpected exception while performing GenerateLintsTask for source /Users/maksimdzikun/workspace/md_proc/lib/definitions.dart
#0      AnalysisTask._safelyPerform (package:analyzer/task/model.dart:351)
#1      AnalysisTask.perform (package:analyzer/task/model.dart:238)
#2      AnalysisDriver.performWorkItem (package:analyzer/src/task/driver.dart:284)
#3      AnalysisDriver.computeResult (package:analyzer/src/task/driver.dart:109)
#4      AnalysisContextImpl.computeResult (package:analyzer/src/context/context.dart:722)
#5      AnalysisContextImpl.computeErrors (package:analyzer/src/context/context.dart:670)
#6      AnalyzerImpl.prepareErrors.<anonymous closure> (package:analyzer_cli/src/analyzer_impl.dart:128)
#7      _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:212)
#8      AnalyzerImpl.prepareErrors (package:analyzer_cli/src/analyzer_impl.dart:126)
#9      AnalyzerImpl._analyzeSync (package:analyzer_cli/src/analyzer_impl.dart:162)
#10     AnalyzerImpl.analyzeSync (package:analyzer_cli/src/analyzer_impl.dart:121)
#11     Driver._runAnalyzer (package:analyzer_cli/src/driver.dart:630)
#12     Driver._analyzeAllImpl (package:analyzer_cli/src/driver.dart:219)
#13     Driver._analyzeAll.<anonymous closure> (package:analyzer_cli/src/driver.dart:162)
#14     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:212)
#15     Driver._analyzeAll (package:analyzer_cli/src/driver.dart:161)
#16     Driver.start (package:analyzer_cli/src/driver.dart:142)
#17     main (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/analyzer_cli/bin/analyzer.dart:11)
#18     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:259)
#19     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)

Caused by The null object does not have a getter 'parameters'.

NoSuchMethodError: method not found: 'parameters'
Receiver: null
Arguments: []
#0      Object._noSuchMethod (dart:core-patch/object_patch.dart:44)
#1      Object.noSuchMethod (dart:core-patch/object_patch.dart:47)
#2      _Visitor.visitMethodDeclaration (package:linter/src/rules/parameter_assignments.dart:81)
#3      DelegatingAstVisitor.visitMethodDeclaration.<anonymous closure> (package:analyzer/dart/ast/visitor.dart:597)
#4      List.forEach (dart:core-patch/growable_array.dart:258)
#5      DelegatingAstVisitor.visitMethodDeclaration (package:analyzer/dart/ast/visitor.dart:597)
#6      MethodDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7226)
#7      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7743)
#8      ClassDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1920)
#9      DelegatingAstVisitor.visitClassDeclaration (package:analyzer/dart/ast/visitor.dart:224)
#10     ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:1852)
#11     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7743)
#12     CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:2452)
#13     DelegatingAstVisitor.visitCompilationUnit (package:analyzer/dart/ast/visitor.dart:252)
#14     CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2445)
#15     GenerateLintsTask.internalPerform (package:analyzer/src/task/dart.dart:3262)
#16     AnalysisTask._safelyPerform (package:analyzer/task/model.dart:339)
#17     AnalysisTask.perform (package:analyzer/task/model.dart:238)
#18     AnalysisDriver.performWorkItem (package:analyzer/src/task/driver.dart:284)
#19     AnalysisDriver.computeResult (package:analyzer/src/task/driver.dart:109)
#20     AnalysisContextImpl.computeResult (package:analyzer/src/context/context.dart:722)
#21     AnalysisContextImpl.computeErrors (package:analyzer/src/context/context.dart:670)
#22     AnalyzerImpl.prepareErrors.<anonymous closure> (package:analyzer_cli/src/analyzer_impl.dart:128)
#23     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:212)
#24     AnalyzerImpl.prepareErrors (package:analyzer_cli/src/analyzer_impl.dart:126)
#25     AnalyzerImpl._analyzeSync (package:analyzer_cli/src/analyzer_impl.dart:162)
#26     AnalyzerImpl.analyzeSync (package:analyzer_cli/src/analyzer_impl.dart:121)
#27     Driver._runAnalyzer (package:analyzer_cli/src/driver.dart:630)
#28     Driver._analyzeAllImpl (package:analyzer_cli/src/driver.dart:219)
#29     Driver._analyzeAll.<anonymous closure> (package:analyzer_cli/src/driver.dart:162)
#30     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:212)
#31     Driver._analyzeAll (package:analyzer_cli/src/driver.dart:161)
#32     Driver.start (package:analyzer_cli/src/driver.dart:142)
#33     main (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/analyzer_cli/bin/analyzer.dart:11)
#34     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:259)
#35     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)


#0      AnalysisContextImpl.computeResult (package:analyzer/src/context/context.dart:727)
#1      AnalysisContextImpl.computeErrors (package:analyzer/src/context/context.dart:670)
#2      AnalyzerImpl.prepareErrors.<anonymous closure> (package:analyzer_cli/src/analyzer_impl.dart:128)
#3      _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:212)
#4      AnalyzerImpl.prepareErrors (package:analyzer_cli/src/analyzer_impl.dart:126)
#5      AnalyzerImpl._analyzeSync (package:analyzer_cli/src/analyzer_impl.dart:162)
#6      AnalyzerImpl.analyzeSync (package:analyzer_cli/src/analyzer_impl.dart:121)
#7      Driver._runAnalyzer (package:analyzer_cli/src/driver.dart:630)
#8      Driver._analyzeAllImpl (package:analyzer_cli/src/driver.dart:219)
#9      Driver._analyzeAll.<anonymous closure> (package:analyzer_cli/src/driver.dart:162)
#10     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:212)
#11     Driver._analyzeAll (package:analyzer_cli/src/driver.dart:161)
#12     Driver.start (package:analyzer_cli/src/driver.dart:142)
#13     main (file:///b/build/slave/dart-sdk-mac-stable/build/sdk/pkg/analyzer_cli/bin/analyzer.dart:11)
#14     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:259)
#15     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)
@alexeieleusis
Copy link
Contributor

Do you know which code was analyzed? Probably better, do you have a snippet of code that reproduces this? I am guessing this is a regression after e91d3bb

Thanks for your report!

@alexeieleusis alexeieleusis self-assigned this Nov 17, 2016
@dikmax
Copy link
Contributor Author

dikmax commented Nov 18, 2016

Looks like this definition makes this crash:

  @override
  int get hashCode => contents.hashCode;

Here's complete class definition:

class Document {
  Iterable<Block> contents;
  Document(this.contents);

  @override
  String toString() => "Document $contents";

  @override
  bool operator ==(dynamic obj) =>
      obj is Document && _iterableEquality.equals(contents, obj.contents);

  @override
  int get hashCode => contents.hashCode;
}

and it crashes until I remove the last override.

@alexeieleusis
Copy link
Contributor

Thank you, looking into it.

@alexeieleusis
Copy link
Contributor

Apparently this is fixed now, added provided snippet to test file and ran without errors, version info:
Dart VM version: 1.21.0-dev.7.0 (Thu Nov 17 02:43:39 2016) on "macos_x64"

It confuses me that the reported linter version is the latest which is only a few days old and the SDK version is a month old, how do you get those numbers?

@dikmax
Copy link
Contributor Author

dikmax commented Nov 20, 2016

I've just taken latest stable versions of DartVM and Linter. All you need is to put linter: ">=0.1.29" into pubspec. Is there something wrong with that?

@alexeieleusis
Copy link
Contributor

I don't think there is anything wrong with that. I expected that particular error to be fixed here aca9843 it confuses me that in dev mode can't be reproduced but you are experiencing it.

I am guessing that this fix was not included in the latest stable release, which is the one you refer and even if you specify a linter version, when running the analyzer (or analysis server) it uses the linter bundled with regardless of you specifying a newer version. I would suggest trying in the next stable release, I guess it will be fixed there.

Can @pq or @bwilkerson please confirm this makes sense?

@bwilkerson
Copy link
Member

It is true that the version of the linter is baked in to the command-line analyzer, so adding a dependency in your pubspec won't change the version of the linter being used.

@pq
Copy link
Member

pq commented Nov 21, 2016

Right. It looks like 0.1.28 is what the SDK is pulling in via DEPS. Any reason not to bump this to 0.1.29?

@bwilkerson
Copy link
Member

Not that I know of.

@pq
Copy link
Member

pq commented Nov 21, 2016

@pq
Copy link
Member

pq commented Nov 21, 2016

Landed in the SDK as of dart-lang/sdk@acafb19. @alexeieleusis : can we optimistically close this?

@alexeieleusis
Copy link
Contributor

Thank you @pq, I guess we can close it. @dikmax please reopen it if still reproducible on the new release, I myself will verify too.

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

4 participants