Skip to content

Crash trying to compile a flutter app with macros #55139

Closed
@jakemac53

Description

@jakemac53

I am trying to test out macros in flutter but am getting a failure today for flutter run -d linux.

You can try my example by cloning https://github.com/jakemac53/macros_example/tree/flutter-app, and running flutter run --enable-experiment macros -d linux (or whichever device you have locally set up, it probably isn't linux specific as this is a kernel compilation failure).

I get the error below:

flutter run --enable-experiment macros -d linux
Launching lib/main.dart on Linux in debug mode...
Unhandled exception:
Crash when compiling:
Unsupported operation: Unexpected library member DynamicTypeDeclarationBuilder(dynamic) (DynamicTypeDeclarationBuilder)

#0      MacroApplications._computeSourceLibraryMacroApplicationData (package:front_end/src/fasta/kernel/macro/macro.dart:518)
#1      MacroApplications.computeLibrariesMacroApplicationData (package:front_end/src/fasta/kernel/macro/macro.dart:374)
#2      SourceLoader.computeMacroApplications (package:front_end/src/fasta/source/source_loader.dart:1719)
#3      KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:436)
#4      withCrashReporting (package:front_end/src/fasta/crash.dart:133)
#5      KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:415)
#6      _buildInternal (package:front_end/src/kernel_generator_impl.dart:151)
#7      generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:119)
<asynchronous suspension>
#8      withCrashReporting (package:front_end/src/fasta/crash.dart:133)
<asynchronous suspension>
#9      kernelForProgramInternal.<anonymous closure> (package:front_end/src/api_prototype/kernel_generator.dart:65)
<asynchronous suspension>
#10     CompilerContext.clear (package:front_end/src/fasta/compiler_context.dart:139)
<asynchronous suspension>
#11     kernelForProgramInternal (package:front_end/src/api_prototype/kernel_generator.dart:64)
<asynchronous suspension>
#12     _compileMacros (package:front_end/src/kernel_generator_impl.dart:365)
<asynchronous suspension>
#13     precompileMacros (package:front_end/src/kernel_generator_impl.dart:314)
<asynchronous suspension>
#14     IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:347)
<asynchronous suspension>
#15     CompilerContext.clear (package:front_end/src/fasta/compiler_context.dart:139)
<asynchronous suspension>
#16     IncrementalCompiler.compile (package:vm/incremental_compiler.dart:77)
<asynchronous suspension>
#17     FrontendCompiler.compile (package:frontend_server/frontend_server.dart:617)
<asynchronous suspension>
#18     listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1311)
<asynchronous suspension>
the Dart compiler exited unexpectedly.

Metadata

Metadata

Assignees

Labels

cfe-feature-macrosImplement macros features in the CFEfeature-macrosImplementation of the macros featurelegacy-area-front-endLegacy: Use area-dart-model instead.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions