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

Generated code doesn't work if there is a field called 'Type' #15

Open
miklcct opened this issue May 16, 2024 · 0 comments · May be fixed by #20
Open

Generated code doesn't work if there is a field called 'Type' #15

miklcct opened this issue May 16, 2024 · 0 comments · May be fixed by #20

Comments

@miklcct
Copy link

miklcct commented May 16, 2024

Sample code

import 'package:morphy_annotation/morphy_annotation.dart';

import 'bar.dart' as bar;

part 'foo.g.dart';
part 'foo.morphy.dart';

@Morphy(generateJson: true)
abstract class $Foo {
    String get Type;
}

The generated code throws error The name 'Type' isn't a type, so it can't be used as a type argument.

miklcct added a commit to Jnction/morphy that referenced this issue May 17, 2024
…t, Map

Also preserve type aliases in generated files

Fixes atreeon#15
@miklcct miklcct linked a pull request May 17, 2024 that will close this issue
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 a pull request may close this issue.

1 participant