Latest update (0.4.0, released several hours ago) has a very bad bug.
Any data field with a capital 'T' in the name appears to break code generation, yielding the standard comment header and the single line:
/*State must be annotated with @generic*/
To reproduce:
The following works properly -- exactly as you would expect:
import 'package:super_enum/super_enum.dart';
part 'super_enum_sample.g.dart';
class SomeVee {
String data;
}
@superEnum
enum _StatesGood {
@Data(fields: [
DataField<SomeVee>('fieldName'),
])
State
}
The following fails, and is the same other than the type of field, now being SomeTee instead of SomeVee (T in the name vs no T in the name).
import 'package:super_enum/super_enum.dart';
part 'super_enum_sample.g.dart';
class SomeTee {
String data;
}
@superEnum
enum _StatesBad {
@Data(fields: [
DataField<SomeTee>('fieldName'),
])
State
}
if (_classFields
.any((e) => type_processor.dataFieldType(e).contains('T'))) {
if (!isGeneric) {
throw InvalidGenerationSourceError(
'${field.name} must be annotated with @generic');
}
}
(Hairy debug session to find this... 'my T' was in a complex type using built values and I had a lot of suspicions to track down before I got to "does it include a capital T' ;-)
Love all the new features, thanks for all your hard work!
Latest update (0.4.0, released several hours ago) has a very bad bug.
Any data field with a capital 'T' in the name appears to break code generation, yielding the standard comment header and the single line:
/*State must be annotated with @generic*/
To reproduce:
The following works properly -- exactly as you would expect:
The following fails, and is the same other than the type of field, now being SomeTee instead of SomeVee (T in the name vs no T in the name).
The problem stems from line 377 of class_generator.dart
(Hairy debug session to find this... 'my T' was in a complex type using built values and I had a lot of suspicions to track down before I got to "does it include a capital T' ;-)
Love all the new features, thanks for all your hard work!