Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cycle reference to union types generate dynamic types #62

Closed
spideythewebhead opened this issue Nov 7, 2022 · 0 comments
Closed

Cycle reference to union types generate dynamic types #62

spideythewebhead opened this issue Nov 7, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@spideythewebhead
Copy link
Owner

Example

@Union()
class MyUnion {
  const factory MyUnion.a({
    required A a,
  }) = A;
}

Generates

class A extends MyUnion {
  ...
  final dynamic a; // should be => final A a;
}

This happens because class A doesn't exist before code generation, so the analyzer marks this as a dynamic instance.

Possible solution: Traverse the Node AST and extract the name of the type.

Needs investigation.

@spideythewebhead spideythewebhead self-assigned this Nov 7, 2022
@spideythewebhead spideythewebhead added the bug Something isn't working label Nov 7, 2022
@spideythewebhead spideythewebhead closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant