Skip to content

analyzer_plugin fails to compile with analyzer 7.4 #60784

Closed
@lishaduck

Description

@lishaduck

If this is a bug report, please help us by providing:

  • In CI (but for some reason not locally), build_runner and dart analyze fail to run. I do use a lockfile, I do run CI with enforce-lockfile, I do see the error in my IDE locally, but I don't get an error when running the CLIs for some reason.
  • I'd expect the latest versions of SDK packages to work together.
  • Dart 3.8.0
[INFO] Precompiling build script......
Warning:  ../../../../../.pub-cache/hosted/pub.dev/analyzer_plugin-0.13.0/lib/src/utilities/change_builder/change_builder_dart.dart:1602:14: Error: The method 'publiclyExporting2' isn't defined for the class 'TopLevelDeclarations'.
 - 'TopLevelDeclarations' is from 'package:analyzer/src/services/top_level_declarations.dart' ('../../../../../.pub-cache/hosted/pub.dev/analyzer-7.4.5/lib/src/services/top_level_declarations.dart').
Try correcting the name to the name of an existing method, or defining a method named 'publiclyExporting2'.
            .publiclyExporting2(element, resultCache: resultCache) ??
             ^^^^^^^^^^^^^^^^^^
[INFO] Precompiling build script... completed, took 6.5s

[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.
Image

It seems to have been fixed, but not released for some reason:

var libraryToImport = resultCache?[element] ??
await TopLevelDeclarations(resolvedUnit)
.publiclyExporting(element, resultCache: resultCache) ??
// Fall back to the element's library if we didn't find a better one.
element.library2;

Metadata

Metadata

Assignees

Labels

P0A serious issue requiring immediate resolutionarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions