Open sandboxFocus

Class RefExtensions

Extension methods for the IRef<T> interface.

Inheritance
RefExtensions
Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public static class RefExtensions

Methods

Name Description
Equals(IRef, IRef?, bool)
GetTarget(IRef, ICompilation, IGenericContext?, Type?)
GetTargetOrNull(IRef, ICompilation, IGenericContext?, Type?)
GetTargetOrNull<T>(IRef<T>)

Gets the target of the reference for the current execution context, or returns null if the reference cannot be resolved.

GetTargetOrNull<T>(IRef<T>, ICompilation, IGenericContext?)

Gets the target of the reference for a given compilation, or returns null if the reference cannot be resolved. To get the reference for the current execution context, use the GetTargetOrNull<T>(IRef<T>, ICompilation, IGenericContext?) extension method.

GetTarget<T>(IRef<T>)

Gets the target of the reference for the current execution context, or throws an exception if the reference cannot be resolved.

GetTarget<T>(IRef<T>, ICompilation, IGenericContext?)

Gets the target of the reference for a given compilation, or throws an exception if the reference cannot be resolved. To get the reference for the current execution context, use the GetTarget<T>(IRef<T>, ICompilation, IGenericContext?) extension method.