Skip to content

Commit

Permalink
Make type output more uniform
Browse files Browse the repository at this point in the history
Summary: Generally we try to be uniform in how we output types, as "<assembly name>:<qualified type name> (type index <number>)". Found another location where we weren't yet doing that.

Differential Revision: D54819056

fbshipit-source-id: 5583fff4300292ce1fd03a461bf496161eda1b45
  • Loading branch information
elliekorn authored and facebook-github-bot committed Mar 12, 2024
1 parent 0603d77 commit d2b1e48
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions AbstractMemorySnapshot/TypeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,10 @@ public Selector BindSelector(Action<string> logWarning, int typeIndex, string[]
fieldNumber = Selector.FieldNumberArraySentinel;
if (!IsArray(currentTypeIndex))
{
logWarning($"field was expected to be an array type; found {QualifiedName(currentTypeIndex)} - selector will never succeed");
logWarning(string.Format("field was expected to be an array type; found {0}:{1} (type index {2}) - selector will never succeed",
Assembly(currentTypeIndex),
QualifiedName(currentTypeIndex),
currentTypeIndex));
return default;
}

Expand All @@ -307,12 +310,20 @@ public Selector BindSelector(Action<string> logWarning, int typeIndex, string[]
{
if (IsValueType(currentTypeIndex))
{
logWarning($"field {fieldNames[i]} not found in type {QualifiedName(currentTypeIndex)}, which is a value type - selector will never succeed");
logWarning(string.Format("field {0} not found in type {1}:{2} (type index {3}), which is a value type - selector will never succeed",
fieldNames[i],
Assembly(currentTypeIndex),
QualifiedName(currentTypeIndex),
currentTypeIndex));
return default;
}
else if (!expectDynamic)
{
logWarning($"field {fieldNames[i]} not found in type {QualifiedName(currentTypeIndex)}; switching to dynamic lookup");
logWarning(string.Format("field {0} not found in type {1}:{2} (type index {3}); switching to dynamic lookup",
fieldNames[i],
Assembly(currentTypeIndex),
QualifiedName(currentTypeIndex),
currentTypeIndex));
}

var dynamicFieldNames = new string[fieldNames.Length - i];
Expand Down

0 comments on commit d2b1e48

Please sign in to comment.