Extension methods for resolving IRef<T> references to their target declarations.
Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public static class RefExtensionsRemarks
This class provides the primary methods for resolving references to declarations. References are used because IDeclaration objects are bound to a specific ICompilation, which changes at each step of the aspect pipeline. References provide a stable way to identify the same declaration across these compilation versions.
Key methods:
- GetTarget<T>(IRef<T>): Resolves a reference using the current execution context.
- GetTarget<T>(IRef<T>, ICompilation, IGenericContext?): Resolves a reference in a specific compilation.
-
GetTargetOrNull<T>(IRef<T>): Like GetTarget but returns
nullinstead of throwing.
Methods
| Name | Description |
|---|---|
| Equals(IRef, IRef?, bool) | |
| GetTarget(IRef, ICompilation, IGenericContext?, Type?) | Resolves a non-generic reference to its target declaration within a specific compilation. |
| GetTargetOrNull(IRef, ICompilation, IGenericContext?, Type?) | Resolves a non-generic reference to its target declaration within a specific compilation, returning |
| GetTargetOrNull<T>(IRef<T>) | Resolves a reference to its target declaration using the current Metalama execution context, returning |
| GetTargetOrNull<T>(IRef<T>, ICompilation, IGenericContext?) | Resolves a reference to its target declaration within a specific compilation, returning |
| GetTarget<T>(IRef<T>) | Resolves a reference to its target declaration using the current Metalama execution context. |
| GetTarget<T>(IRef<T>, ICompilation, IGenericContext?) | Resolves a reference to its target declaration within a specific compilation. |