google / google/protobuf.dart

Generate `toBuilder` overrides with covariate return type

Open
#177 17 comments 2 reactions 0 assignees View on GitHub
feature request
Dominant language
Dart
Stars
572
Forks
196
Avg merge
1h 59m
Merged PRs (30d)
2

Description

At the moment `toBuilder` methods are only defined on the `GeneratedMessage`, which means they are always of type `GeneratedMessage`. This works poorly when `no-implicit-casts` is used as it requires explicit casting to the actual type.

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by locating the Dart generator and the GeneratedMessage definition, then trace how toBuilder is currently declared and emitted. Done means generated message classes provide toBuilder overrides with covariant concrete return types, avoiding explicit casts when no-implicit-casts is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.