Skip to content

Commit

Permalink
oops, fix incorrect return types in strong mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Slesinsky committed Apr 1, 2016
1 parent 6d131e3 commit 4fa71f5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/src/protobuf/field_set.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class _FieldSet {
throw new ArgumentError("tag $tagNumber not defined in $_messageName");
}

/*T*/ _getDefault/*<T>*/(FieldInfo/*<T>*/ fi) {
_getDefault(FieldInfo fi) {
if (!fi.isRepeated) return fi.makeDefault();
if (_isReadOnly) return _emptyList;

Expand Down Expand Up @@ -237,12 +237,12 @@ class _FieldSet {
// Generated method implementations

/// The implementation of a generated getter.
/*T*/ _$get/*<T>*/(int index, int tagNumber, /*T*/ defaultValue) {
/*=T*/ _$get/*<T>*/(int index, int tagNumber, /*=T*/ defaultValue) {
assert(_nonExtensionInfo(tagNumber).index == index);
var value = _values[index];
if (value != null) return value;
if (value != null) return value as dynamic/*=T*/;
if (defaultValue != null) return defaultValue;
return _getDefault(_nonExtensionInfo(tagNumber));
return _getDefault(_nonExtensionInfo(tagNumber)) as dynamic/*=T*/;
}

/// The implementation of a generated has method.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/protobuf/generated_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
part of protobuf;

typedef GeneratedMessage CreateBuilderFunc();
typedef Object MakeDefaultFunc();
typedef MakeDefaultFunc();
typedef ProtobufEnum ValueOfFunc(int value);

/// The base class for all protobuf message types.
Expand Down Expand Up @@ -275,7 +275,7 @@ abstract class GeneratedMessage {
void setField(int tagNumber, value) => _fieldSet._setField(tagNumber, value);

/// For generated code only.
/*T*/ $_get/*<T>*/(int index, int tagNumber, /*T*/ defaultValue) =>
/*=T*/ $_get/*<T>*/(int index, int tagNumber, /*=T*/ defaultValue) =>
_fieldSet._$get/*<T>*/(index, tagNumber, defaultValue);

/// For generated code only.
Expand Down
2 changes: 1 addition & 1 deletion test/mock_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class MockMessage extends GeneratedMessage {
MockMessage get child => $_get(2, 3, null);
set child(x) => setField(3, x);

List<int> get int32s => $_get(3, 4, null) as List<int>;
List<int> get int32s => $_get(3, 4, null);

@override
BuilderInfo get info_ {
Expand Down

0 comments on commit 4fa71f5

Please sign in to comment.