Skip to content

The dart analyzer has terminated #4666

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

Closed
MarsadMaqsood opened this issue Jul 27, 2023 · 2 comments
Closed

The dart analyzer has terminated #4666

MarsadMaqsood opened this issue Jul 27, 2023 · 2 comments
Labels
upstream in dart / flutter Needs changing in Dart or Flutter

Comments

@MarsadMaqsood
Copy link

Describe the bug
The dart analyzer has terminated
The Dart analyzer stopped working in some cases

  • When adding certain keywords
  • When running an app on a physical device using wireless debugging

To Reproduce
Steps to reproduce the behavior:

  1. Open Vs Code

  2. Add the const keyword to the constructor and also return something Code

  3. This also happens if you connect your device using wireless debugging and run the app (I tested on different flutter projects and every time it says dart analyzer ...)

Expected behavior
There should be a warning message, not the dart analyzer to stop working.

Screenshots

Screenshot 1

SC 1

Screenshot 2 (With Issue)

SC 2

Please complete the following information:

  • Operating System and version:
  • VS Code version: 1.80.1
  • Dart extension version: 3.68.1
  • Dart/Flutter SDK version: 3.10.6
  • Target device (if the issue relates to Flutter debugging):
@DanTup
Copy link
Member

DanTup commented Jul 31, 2023

Thanks for the excellent repro - I can trigger this on current stable:

[12:12:14 PM] [Analyzer] [Error] Unhandled exception:
Exception: Missing implementation of visitFunctionExpression
#0      ThrowingAstVisitor._throw (package:analyzer/dart/ast/visitor.dart:2842:5)
#1      ThrowingAstVisitor.visitFunctionExpression (package:analyzer/dart/ast/visitor.dart:2514:58)
#2      FunctionExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:6124:50)
#3      AstBinaryWriter._writeNodeList (package:analyzer/src/summary2/ast_binary_writer.dart:939:19)
#4      AstBinaryWriter.visitArgumentList …

@DanTup
Copy link
Member

DanTup commented Jul 31, 2023

I was able to reduce this to:

class StylishBottomBar  {
  const StylishBottomBar({
    List<String?> items,
  }) : assert(items.every((String? item) => item != null));
}

It seems to be a Dart analyzer issue so I've moved this to dart-lang/sdk#53075 and it'll be fixed (and ship) in a future Dart/Flutter SDK release.

Thanks!

@DanTup DanTup closed this as completed Jul 31, 2023
@DanTup DanTup added upstream in dart / flutter Needs changing in Dart or Flutter and removed is bug labels Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream in dart / flutter Needs changing in Dart or Flutter
Projects
None yet
Development

No branches or pull requests

2 participants