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 xamarin#4978

Commit xamarin@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: xamarin#4978
  • Loading branch information
spouliot committed Oct 12, 2018
1 parent f4dbb68 commit 91b29bd
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

0 comments on commit 91b29bd

Please sign in to comment.