Commit cb8644df authored by Jon Skeet's avatar Jon Skeet Committed by unknown

Fixed a couple of warnings

parent c784be31
...@@ -65,7 +65,6 @@ namespace Google.ProtocolBuffers { ...@@ -65,7 +65,6 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Works out the builder type for TMessage, or throws an ArgumentException to explain why it can't. /// Works out the builder type for TMessage, or throws an ArgumentException to explain why it can't.
/// This will check
/// </summary> /// </summary>
private static Type FindBuilderType() { private static Type FindBuilderType() {
MethodInfo createBuilderMethod = typeof(TMessage).GetMethod("CreateBuilder", Type.EmptyTypes); MethodInfo createBuilderMethod = typeof(TMessage).GetMethod("CreateBuilder", Type.EmptyTypes);
...@@ -87,6 +86,9 @@ namespace Google.ProtocolBuffers { ...@@ -87,6 +86,9 @@ namespace Google.ProtocolBuffers {
return builderType; return builderType;
} }
// This is only ever fetched by reflection, so the compiler may
// complain that it's unused
#pragma warning disable 0414
/// <summary> /// <summary>
/// Method we'll use to build messageReader, with the first parameter fixed to TMessage.CreateBuilder. Note that we /// Method we'll use to build messageReader, with the first parameter fixed to TMessage.CreateBuilder. Note that we
/// have to introduce another type parameter (TMessage2) as we can't constrain TMessage for just a single method /// have to introduce another type parameter (TMessage2) as we can't constrain TMessage for just a single method
...@@ -102,6 +104,7 @@ namespace Google.ProtocolBuffers { ...@@ -102,6 +104,7 @@ namespace Google.ProtocolBuffers {
input.ReadMessage(builder, registry); input.ReadMessage(builder, registry);
return builder.Build(); return builder.Build();
} }
#pragma warning restore 0414
private static readonly uint ExpectedTag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); private static readonly uint ExpectedTag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited);
......
...@@ -54,6 +54,15 @@ namespace Google.ProtocolBuffers { ...@@ -54,6 +54,15 @@ namespace Google.ProtocolBuffers {
} }
/// <summary>
/// Returns a read-only list of human-readable names of
/// required fields missing from this message. Each name
/// is a full path to a field, e.g. "foo.bar[5].baz"
/// </summary>
public IList<string> MissingFields {
get { return missingFields; }
}
/// <summary> /// <summary>
/// Converts this exception into an InvalidProtocolBufferException. /// Converts this exception into an InvalidProtocolBufferException.
/// When a parsed message is missing required fields, this should be thrown /// When a parsed message is missing required fields, this should be thrown
...@@ -138,6 +147,3 @@ namespace Google.ProtocolBuffers { ...@@ -138,6 +147,3 @@ namespace Google.ProtocolBuffers {
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment