Daniel Arechiga
Daniel Arechiga

Reputation: 967

Is it fine to restore a reserved field in a proto definition?

Say I commented out a field in a proto definition and set the number in the reserved fields, but now I want to restore it. Can I take it out of reserved and assign the number back? Or should I use a new number. Are there any implications on the former?

e.g. If I want to use manufacturer again

message ProductDetail {
    reserved 2;
    string name = 1;   
    // string manufacturer = 2;
}

Upvotes: 2

Views: 1741

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1063328

Yes, that's fine, as long as the meaning hasn't changed.

Upvotes: 1

Related Questions