Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Side by Side Diff: lib/src/protobuf/extension.dart

Issue 814213003: Allow constants as field initial values as well as creation thunks (Closed) Base URL: https://github.com/dart-lang/dart-protobuf@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/protobuf/builder_info.dart ('k') | lib/src/protobuf/field_info.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of protobuf; 5 part of protobuf;
6 6
7 /** 7 /**
8 * An object representing an extension field. 8 * An object representing an extension field.
9 */ 9 */
10 class Extension extends FieldInfo { 10 class Extension extends FieldInfo {
11 11
12 final String extendee; 12 final String extendee;
13 13
14 Extension(this.extendee, String name, int tagNumber, int fieldType, 14 Extension(this.extendee, String name, int tagNumber, int fieldType,
15 [MakeDefaultFunc makeDefault, 15 [dynamic defaultOrMaker,
16 CreateBuilderFunc subBuilder, 16 CreateBuilderFunc subBuilder,
17 ValueOfFunc valueOf]) : 17 ValueOfFunc valueOf]) :
18 super(name, tagNumber, fieldType, makeDefault, subBuilder, valueOf); 18 super(name, tagNumber, fieldType, defaultOrMaker, subBuilder, valueOf);
19 19
20 int get hashCode => extendee.hashCode * 31 + tagNumber; 20 int get hashCode => extendee.hashCode * 31 + tagNumber;
21 21
22 bool operator ==(other) { 22 bool operator ==(other) {
23 if (other is! Extension) return false; 23 if (other is! Extension) return false;
24 24
25 Extension o = other; 25 Extension o = other;
26 return extendee == o.extendee && tagNumber == o.tagNumber; 26 return extendee == o.extendee && tagNumber == o.tagNumber;
27 } 27 }
28 } 28 }
29
OLDNEW
« no previous file with comments | « lib/src/protobuf/builder_info.dart ('k') | lib/src/protobuf/field_info.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698