atreeon / morphy

Provides a clean class definition with extra functionality including; copy with, json serializable, tostring, equals that supports inheritance and polymorphism
4 stars 2 forks source link

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

Open miklcct opened 4 months ago

miklcct commented 4 months ago

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.