Types Generated using the LibraryTypesMacro throws an error when instantiating #56107
Labels
area-front-end
Use area-front-end for front end / CFE / kernel format related issues.
cfe-feature-macros
Implement macros features in the CFE
feature-macros
Implementation of the macros feature
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
I've been experimenting with the new feature Macros and I'm trying to use it to introduce a new class/Type in a library. The editor successfully shows me the library augment but I cannot instantiate this new class.
This was tested using the following:
macros: ^0.1.0-main.5
usingDart SDK version: 3.5.0-180.3.beta (beta) (Wed Jun 5 15:06:15 2024 +0000) on "linux_x64"
macros: ^0.1.2-main.4
usingDart SDK version: 3.5.0-307.0.dev (dev) (None) on "linux_x64"
Minimally reproducible example:
dart create -t package macro_library_bug
analysis_options.yaml
file to enable macrospubspec.yaml
file and add a dependency on macrosdart pub get
lib/src/macro_library_bug_base.dart
file and create a new LibraryTypeMacrolib/macro_library_bug.dart
file and annotate the library with@LibraryAnnotator()
example/macro_library_bug_example.dart
filedart --enable-experiment=macros example/macro_library_bug_example.dart
Expected Result
The console should show
Instance of MyLibType
** Actual Result **
The text was updated successfully, but these errors were encountered: