Skip to content

Generated Class From Macro Not Resolved When Used As Function Argument #59772

Open
@mcmah309

Description

@mcmah309

A generated class from a macro is not resolved when used as a function argument

Example Here: https://github.com/mcmah309/algebraic_types/blob/17cd50aaccc62340cecb78e8c4848fcfd8dbfa17/serde_test/dart/bin/dart.dart#L41

dart run --enable-experiment=macros
bin/dart.dart:41:34: Error: Type 'Action' not found.
Future<void> enumStruct(Uri url, Action action) async {
                                 ^^^^^^

But when not used as a function argument, it compiles and runs fine

Example: https://github.com/mcmah309/algebraic_types/blob/63d61af6a428f7af04e1ca3f0421e6474c4f2c42/serde_test/dart/bin/dart.dart#L31-L48

out:

enumStruct response received:
Action: {Create: {id: 1, name: Example}}
Action: Create

Dart info:

#### General info

- Dart 3.7.0-232.0.dev (dev) (None) on "linux_x64"
- on linux / Linux 6.6.63 #1-NixOS SMP PREEMPT_DYNAMIC Fri Nov 22 14:38:37 UTC 2024
- locale is en_US.UTF-8

#### Project info

- sdk constraint: '^3.7.0-232.0.dev'
- dependencies: http, json
- dev_dependencies: lints, test
- elided dependencies: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    cfe-feature-macrosImplement macros features in the CFElegacy-area-front-endLegacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions