google / google/built_value.dart

Could SerializeFor() warn if class doesn't have a serializer?

Open
#1,112 1 comment 0 reactions 1 assignee Claimed by @davidmorgan View on GitHub
p2 / feature request
Dominant language
Dart
Stars
886
Forks
195
Avg merge
1d 11h
Merged PRs (30d)
4

Description

I have this:

```dart
@SerializersFor([
CellState,
])
final Serializers serializers = _$serializers;
```

But was getting an error about there being no serialiser for `$_CellState`. It took me a while to realise I needed to add the `serializer` to the class:

```dart
static Serializer get serializer => _$cellStateSerializer;
```

Is it possible a warning could be produced when building the code in this case, rather than waiting to throw at runtime?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.