aboutsummaryrefslogtreecommitdiffhomepage
path: root/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs')
-rw-r--r--csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs5
1 files changed, 1 insertions, 4 deletions
diff --git a/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs b/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs
index 8c24e46e..f00a51ba 100644
--- a/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs
+++ b/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs
@@ -48,11 +48,8 @@ namespace Google.Protobuf.Reflection
private readonly Action<object, object> setValueDelegate;
private readonly Action<object> clearDelegate;
- internal SingleFieldAccessor(Type type, string propertyName, FieldDescriptor descriptor) : base(type, propertyName, descriptor)
+ internal SingleFieldAccessor(PropertyInfo property, FieldDescriptor descriptor) : base(property, descriptor)
{
- PropertyInfo property = type.GetProperty(propertyName);
- // We know there *is* such a property, or the base class constructor would have thrown. We should be able to write
- // to it though.
if (!property.CanWrite)
{
throw new ArgumentException("Not all required properties/methods available");