Skip to content
This repository has been archived by the owner on Jan 27, 2019. It is now read-only.

Commit

Permalink
Add warning if CA named argument cannot be resolved
Browse files Browse the repository at this point in the history
Fix #29
  • Loading branch information
yck1509 committed Jun 20, 2014
1 parent 10aa69c commit 3d416d5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Confuser.Renamer/Analyzers/TypeBlobAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,17 @@ public void Analyze(ConfuserContext context, INameService service, IDnlibDef def

foreach (CANamedArgument fieldArg in attr.Fields) {
FieldDef field = attrType.FindField(fieldArg.Name, new FieldSig(fieldArg.Type));
service.AddReference(field, new CAMemberReference(fieldArg, field));
if (field == null)
context.Logger.WarnFormat("Failed to resolve CA field '{0}::{1} : {2}'.", attrType, fieldArg.Name, fieldArg.Type);
else
service.AddReference(field, new CAMemberReference(fieldArg, field));
}
foreach (CANamedArgument propertyArg in attr.Properties) {
PropertyDef property = attrType.FindProperty(propertyArg.Name, new PropertySig(true, propertyArg.Type));
service.AddReference(property, new CAMemberReference(propertyArg, property));
if (property == null)
context.Logger.WarnFormat("Failed to resolve CA property '{0}::{1} : {2}'.", attrType, propertyArg.Name, propertyArg.Type);
else
service.AddReference(property, new CAMemberReference(propertyArg, property));
}
}
}
Expand Down

0 comments on commit 3d416d5

Please sign in to comment.