|
20 | 20 | using System.Collections.Generic; |
21 | 21 | using System.Diagnostics; |
22 | 22 | using System.Linq; |
| 23 | +using System.Net.NetworkInformation; |
23 | 24 |
|
24 | 25 | using ICSharpCode.Decompiler.Semantics; |
25 | 26 | using ICSharpCode.Decompiler.TypeSystem; |
@@ -81,6 +82,7 @@ public class MethodGroupResolveResult : ResolveResult |
81 | 82 | readonly IReadOnlyList<IType> typeArguments; |
82 | 83 | readonly ResolveResult targetResult; |
83 | 84 | readonly string methodName; |
| 85 | + IMethod chosenMethod; |
84 | 86 |
|
85 | 87 | public MethodGroupResolveResult(ResolveResult targetResult, string methodName, |
86 | 88 | IReadOnlyList<MethodListWithDeclaringType> methods, IReadOnlyList<IType> typeArguments) |
@@ -148,6 +150,20 @@ public IReadOnlyList<IType> TypeArguments { |
148 | 150 | // the resolver is used to fetch extension methods on demand |
149 | 151 | internal CSharpResolver resolver; |
150 | 152 |
|
| 153 | + /// <summary> |
| 154 | + /// Gets the method that was chosen for this group. |
| 155 | + /// |
| 156 | + /// Only set for MethodGroupResolveResults found in ILSpy AST annotations. |
| 157 | + /// </summary> |
| 158 | + public IMethod ChosenMethod => chosenMethod; |
| 159 | + |
| 160 | + public MethodGroupResolveResult WithChosenMethod(IMethod method) |
| 161 | + { |
| 162 | + var result = (MethodGroupResolveResult)ShallowClone(); |
| 163 | + result.chosenMethod = method; |
| 164 | + return result; |
| 165 | + } |
| 166 | + |
151 | 167 | /// <summary> |
152 | 168 | /// Gets all candidate extension methods. |
153 | 169 | /// Note: this includes candidates that are not eligible due to an inapplicable |
|
0 commit comments