Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Merge changes from TFS #5397

Merged
merged 1 commit into from
Feb 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ public sealed override Type FieldType
{
get
{
return this.FieldRuntimeType;
Type fieldType = _lazyFieldType;
if (fieldType == null)
{
_lazyFieldType = fieldType = this.FieldRuntimeType;
}

return fieldType;
}
}

Expand Down Expand Up @@ -292,6 +298,8 @@ protected RuntimeFieldInfo WithDebugName()

private volatile FieldAccessor _lazyFieldAccessor = null;

private volatile Type _lazyFieldType = null;

private String _debugName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,14 @@ public sealed override Type PropertyType
ReflectionTrace.PropertyInfo_PropertyType(this);
#endif

TypeContext typeContext = ContextTypeInfo.TypeContext;
return PropertyTypeHandle.Resolve(typeContext);
Type propertyType = _lazyPropertyType;
if (propertyType == null)
{
TypeContext typeContext = ContextTypeInfo.TypeContext;
_lazyPropertyType = propertyType = PropertyTypeHandle.Resolve(typeContext);
}

return propertyType;
}
}

Expand Down Expand Up @@ -402,6 +408,8 @@ private object GetConstantValue(bool raw)

private volatile ParameterInfo[] _lazyIndexParameters;

private volatile Type _lazyPropertyType;

private String _debugName;
}
}
Expand Down