Closed gabrielmcreynolds closed 1 month ago
I have the exact same issue! I think this is a reasonable and rather common pattern, too.
Is this a regression? @gabrielmcreynolds did you find a workaround?
Confirmed not working at least from 4.1.0 to 4.2.3.
Indeed a bug, will work on a fix.
I have the exact same issue! I think this is a reasonable and rather common pattern, too.
Is this a regression? @gabrielmcreynolds did you find a workaround?
No, I was not able to find a work around.
Fixed in v4.3.0
When there is nullable generics the build runner is generating a
.mapper
file that contains an error. Below is a minimally reproducable example:nullable_generics.mapper.dart
```dart // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint // ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member // ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter part of 'nullable_generics.dart'; class NullableGenericsMapper extends ClassMapperBaseThe error being thrown is
I'm assuming this is coming from the
T extends Object
line and it is just not checking if the generic type is nullable.