Table of Contents

Struct SymbolResolutionResult

Namespace
RDCore.SDK.Runtime.Shared
Assembly
RDCore.SDK.dll

The result of resolving an identifier name against a scope. Mirrors the other *Result records: it carries a payload — the bound Symbol — or a diagnostic, never both.

public readonly record struct SymbolResolutionResult : IEquatable<SymbolResolutionResult>
Implements
Inherited Members

Remarks

The resolver reports which compile-time error a lookup hit, not a located VBCompileErrorInfo — it does not know where the reference is. The caller, which has the syntax node, builds the diagnostic from ErrorId and Candidates.

  • DuplicateDeclaration — the name is declared more than once within one module or procedure.
  • AmbiguousName — the name resolves in more than one enclosing scope (members promoted from different modules or references); the reference must qualify it.

Constructors

SymbolResolutionResult(Symbol?, VBCompileErrorId?, ImmutableArray<Symbol>)

The result of resolving an identifier name against a scope. Mirrors the other *Result records: it carries a payload — the bound Symbol — or a diagnostic, never both.

public SymbolResolutionResult(Symbol? Symbol, VBCompileErrorId? ErrorId, ImmutableArray<Symbol> Candidates)

Parameters

Symbol Symbol

The bound symbol, or null when the name is unbound or in error.

ErrorId VBCompileErrorId?

The compile-time error the lookup hit, or null.

Candidates ImmutableArray<Symbol>

The colliding declarations for an error result; empty otherwise.

Remarks

The resolver reports which compile-time error a lookup hit, not a located VBCompileErrorInfo — it does not know where the reference is. The caller, which has the syntax node, builds the diagnostic from ErrorId and Candidates.

  • DuplicateDeclaration — the name is declared more than once within one module or procedure.
  • AmbiguousName — the name resolves in more than one enclosing scope (members promoted from different modules or references); the reference must qualify it.

Fields

Unbound

The name is declared nowhere visible from the origin scope.

public static readonly SymbolResolutionResult Unbound

Field Value

SymbolResolutionResult

Properties

Candidates

The colliding declarations for an error result; empty otherwise.

public ImmutableArray<Symbol> Candidates { get; init; }

Property Value

ImmutableArray<Symbol>

ErrorId

The compile-time error the lookup hit, or null.

public VBCompileErrorId? ErrorId { get; init; }

Property Value

VBCompileErrorId?

IsError

true when the lookup hit a compile-time error.

public bool IsError { get; }

Property Value

bool

IsResolved

true when the name bound to exactly one symbol.

public bool IsResolved { get; }

Property Value

bool

IsUnbound

true when no scope declared the name — not an error in itself.

public bool IsUnbound { get; }

Property Value

bool

Symbol

The bound symbol, or null when the name is unbound or in error.

public Symbol? Symbol { get; init; }

Property Value

Symbol

Methods

Ambiguous(IEnumerable<Symbol>)

The name resolves in more than one enclosing scope and must be qualified (AmbiguousName).

public static SymbolResolutionResult Ambiguous(IEnumerable<Symbol> candidates)

Parameters

candidates IEnumerable<Symbol>

Returns

SymbolResolutionResult

Duplicate(IEnumerable<Symbol>)

The name is declared more than once in a single scope (DuplicateDeclaration).

public static SymbolResolutionResult Duplicate(IEnumerable<Symbol> candidates)

Parameters

candidates IEnumerable<Symbol>

Returns

SymbolResolutionResult

Resolved(Symbol)

A successful resolution to symbol.

public static SymbolResolutionResult Resolved(Symbol symbol)

Parameters

symbol Symbol

Returns

SymbolResolutionResult