GetTargetInterface(ICompilation, Type?, IGenericContext?, bool)
Gets the target of the reference for a given compilation, with control over the interface type and error handling. Prefer the extension methods GetTarget<T>(IRef<T>, ICompilation, IGenericContext?) or GetTargetOrNull<T>(IRef<T>, ICompilation, IGenericContext?) for typical usage.
Declaration
ICompilationElement? GetTargetInterface(ICompilation compilation, Type? interfaceType, IGenericContext? genericContext = null, bool throwIfMissing = false)Parameters
| Type | Name | Description |
|---|---|---|
| ICompilation | compilation | The compilation in which to resolve the reference. |
| Type | interfaceType | The optional interface type to use for the target, or |
| IGenericContext | genericContext | The optional generic context for resolving generic instances. |
| bool | throwIfMissing | If |
Returns
| Type | Description |
|---|---|
| ICompilationElement | The resolved compilation element, or |