google / reflectable.dart

Reflectable is a Dart library that allows programmers to eliminate certain usages of dynamic reflection by specialization of reflective code to an equivalent implementation using only static techniques. The use of dynamic reflection is constrained in order to ensure that the specialized code can be generated and will have a reasonable size.
https://pub.dev/packages/reflectable
BSD 3-Clause "New" or "Revised" License
381 stars 57 forks source link

Bug: Reflectable doesn't work with latest analyzer 4.4.0 package #286

Closed zottel4242 closed 2 years ago

zottel4242 commented 2 years ago

A few days ago analyzer 4.4.0 was released. Reflectable doesn't seem to be compatible with it. It causes the following error on my machines (Windows, Linux):

Building package executable...
Built build_runner:build_runner.
[INFO] Generating build script completed, took 314ms
[WARNING] ../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/reflectable-3.0.9/lib/src/builder_implementation.dart:5317:11: Error: No named parameter with the name 'element'.
          element: this,
../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/analyzer-4.4.0/lib/src/dart/element/type.dart:451:3: Context: Found this candidate, but the arguments don't match.
  InterfaceTypeImpl({
  ^^^^^^^^^^^^^^^^^
[INFO] Precompiling build script... completed, took 1.1s
[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.

I now use the workaround to force analyzer to 4.3.1 in the pubspec.yaml of my project: analyzer: 4.3.1

eernstg commented 2 years ago

Thanks for reporting this! The analyzer had a number of breaking changes, so the migration to 4.4.0 will not be coming immediately. Hopefully in a week or two, depending on the number of opportunities I get to look at it.

praxder commented 2 years ago

Bump. Still seeing this issue.

eernstg commented 2 years ago

The work is ongoing, I uploaded the current status as https://github.com/google/reflectable.dart/pull/288.