Skip to content

Commit

Permalink
[linker] Set flag when processing ParameterInfo.get_Name from XML fil…
Browse files Browse the repository at this point in the history
…es. Fixes #4978 (#4981)

Commit 996d906 fixed the use of XML files. However it did not set the flags so if it's used in both XML and in code then the dictionary is being added twice, which throws an exception like

```
error MT2102: Error processing the method 'System.Boolean SignalGo.Shared.Helpers.ReflectionHelper/d__0::MoveNext()' in the assembly 'SignalGo.Shared.dll': An item with the same key has already been added. Key: System.String System.Reflection.ParameterInfo::get_Name()
```

reference: #4978
  • Loading branch information
spouliot authored Oct 15, 2018
1 parent d13f66a commit 855e682
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/linker/MonoTouch.Tuner/MonoTouchMarkStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ protected override MethodDefinition MarkMethod (MethodReference reference)
if (current_method == null) {
// This can happen if ParameterInfo.get_Name is preserved in an xml file
Annotations.GetCustomAnnotations ("ParameterInfo").Add (method, null);
parameter_info = true;
} else {
var a = current_method.DeclaringType.Module.Assembly;
if (!Profile.IsSdkAssembly (a) && !Profile.IsProductAssembly (a)) {
Expand Down

1 comment on commit 855e682

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jenkins job (on internal Jenkins) succeeded

Build succeeded
API Diff (from stable)
ℹ️ API Diff (from PR only) (please review changes)
Generator Diff (no change)
Test run succeeded

Please sign in to comment.