diff options
author | Rolf Bjarne Kvinge <rolf@xamarin.com> | 2012-02-25 03:02:46 +0400 |
---|---|---|
committer | Rolf Bjarne Kvinge <rolf@xamarin.com> | 2012-02-25 03:04:57 +0400 |
commit | fe53f3ef6e6a9cf1e2161a1a8d2565b000338c70 (patch) | |
tree | 5af96748aa8ee0627a91048bd55854d0189f895b /gui-compare | |
parent | 0827dbf2e81fa0f485f73955885e4bfc7304a389 (diff) |
gui-compare: Distinguish between ref and out parameters.
And parameters with the (IL) Out attribute aren't necessarily
C# out parameters, they might have the System.Runtime.InteropServices.OutAttribute
applied (in which case they're not byreference types).
Diffstat (limited to 'gui-compare')
-rw-r--r-- | gui-compare/CecilMetadata.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gui-compare/CecilMetadata.cs b/gui-compare/CecilMetadata.cs index 2387b5eb..d356a0e4 100644 --- a/gui-compare/CecilMetadata.cs +++ b/gui-compare/CecilMetadata.cs @@ -1011,15 +1011,18 @@ namespace GuiCompare { sb.Append ('('); bool first_p = true; foreach (ParameterDefinition p in method_def.Parameters) { + TypeReference paramType = p.ParameterType; if (!first_p) sb.Append (", "); first_p = false; if (p.IsIn) sb.Append ("in "); - else if (p.IsOut) - sb.Append ("out "); + else if (paramType.IsByReference) { + sb.Append (p.IsOut ? "out " : "ref "); + paramType = paramType.GetElementType (); + } sb.Append (beautify - ? CecilUtils.PrettyType (p.ParameterType) + ? CecilUtils.PrettyType (paramType) : CecilUtils.FormatTypeLikeCorCompare (p.ParameterType)); if (beautify) { sb.Append (" "); |