google / google/built_value.dart
Non nullable field with Built type is not enforced
Open
question
- Dominant language
- Dart
- Stars
- 886
- Forks
- 195
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 4
Description
The following assertion fails (doesn't throw)
```dart
expect(
() => Foo(),
throwsA(isA()),
reason: 'Should fail without required bar param',
);
```
```dart
abstract class Foo implements Built {
Bar get bar;
}
abstract class Bar implements Built {}
```
It also fails on deserialization, when bar is null in the serialized input.
It passes, when the `Foo` is annotated with `@BuiltValue(autoCreateNestedBuilders: false)` but I'd like that as `true`. Would there be any other way?
Contributor guide
Assessment
This issue has not been assessed yet.