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

Fix incompatibility with dart 3 #917

Closed
wants to merge 1 commit into from

Conversation

josiahsrc
Copy link

@josiahsrc josiahsrc commented May 20, 2023

This is a very crude attempt at fixing an InvalidType code generation issue. I've isolated the problem to these two spots in the code base.

fixes #916

Comment on lines +76 to +78
if (displayType.contains('InvalidType')) {
displayType = displayType.replaceAll('InvalidType', 'dynamic');
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There must be a better way to do this. Rather than matching for the InvalidType string, it would be better to check that the type is an InvalidType dart type

@rrousselGit
Copy link
Owner

Hello!

This would need tests :)

Could you maybe add a class which does:

@freezed
class Example with _$Example {
  factory Example(
    CodeGenerated a,
    List<CodeGenerated> b,
    List<List<CodeGenerated>> c,
  ) = _Example;
}

@SunlightBro
Copy link

Ok I'm so sorry ... I opened a new PR #921 without checking that this one already exists 🙈.

@josiahsrc
Copy link
Author

Ok I'm so sorry ... I opened a new PR #921 without checking that this one already exists 🙈.

@SunlightBro Not a problem! Your PR looks much more sophisticated. Although it would be cool to have my name in the freezed contributors section, I'm all for correctness. Feel free to close this if your PR solves a superset of what this one solves 😁

I'll hold off writing tests for this PR until then

@rrousselGit
Copy link
Owner

I'll close this then. But I really appreciate your effort :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incompatibility with dart 3
3 participants