Table of Contents

Class ConversionFact

Namespace
RDCore.SDK.Semantics.Facts
Assembly
RDCore.SDK.dll

A let-coercion (MS-VBAL 5.5.1.2) that the code asks for, as the language core states it.

public sealed record ConversionFact : IEquatable<ConversionFact>
Inheritance
ConversionFact
Implements
Inherited Members

Remarks

👉 A fact is stated only when it is true of the code: anything that follows from a value an analysis only assumed (IsValueKnown is false) is not stated, so Error is null then, and Flags holds what the types alone say.

Constructors

ConversionFact(SyntaxNodeId, SourceLocation, ConversionSite, InputIndex, VBType, VBType, ConversionSemanticFlags, bool, VBErrorInfo?)

A let-coercion (MS-VBAL 5.5.1.2) that the code asks for, as the language core states it.

public ConversionFact(SyntaxNodeId Node, SourceLocation Location, ConversionSite Site, InputIndex Operand, VBType Source, VBType Destination, ConversionSemanticFlags Flags, bool IsValueKnown, VBErrorInfo? Error)

Parameters

Node SyntaxNodeId

The Identity of the syntax node the conversion is evaluated for.

Location SourceLocation

Where in the document the conversion is.

Site ConversionSite

The construct that asks for the conversion.

Operand InputIndex

The operand that is converted: its position in the operation that converts it.

Source VBType

The declared type of the value that is converted.

Destination VBType

The type it is converted to.

Flags ConversionSemanticFlags

What the conversion does, and what is known about its source (Narrowing, Lossy, NullOperand, ...). Always one of Implicit or Explicit.

IsValueKnown bool

Whether the value that is converted is known, as opposed to a value the type merely allows.

Error VBErrorInfo

The run-time error the conversion raises. Only stated when the value is known, or when the types alone guarantee it.

Remarks

👉 A fact is stated only when it is true of the code: anything that follows from a value an analysis only assumed (IsValueKnown is false) is not stated, so Error is null then, and Flags holds what the types alone say.

Properties

Destination

The type it is converted to.

public VBType Destination { get; init; }

Property Value

VBType

Error

The run-time error the conversion raises. Only stated when the value is known, or when the types alone guarantee it.

public VBErrorInfo? Error { get; init; }

Property Value

VBErrorInfo

Flags

What the conversion does, and what is known about its source (Narrowing, Lossy, NullOperand, ...). Always one of Implicit or Explicit.

public ConversionSemanticFlags Flags { get; init; }

Property Value

ConversionSemanticFlags

IsValueKnown

Whether the value that is converted is known, as opposed to a value the type merely allows.

public bool IsValueKnown { get; init; }

Property Value

bool

Location

Where in the document the conversion is.

public SourceLocation Location { get; init; }

Property Value

SourceLocation

Node

The Identity of the syntax node the conversion is evaluated for.

public SyntaxNodeId Node { get; init; }

Property Value

SyntaxNodeId

Operand

The operand that is converted: its position in the operation that converts it.

public InputIndex Operand { get; init; }

Property Value

InputIndex

Site

The construct that asks for the conversion.

public ConversionSite Site { get; init; }

Property Value

ConversionSite

Source

The declared type of the value that is converted.

public VBType Source { get; init; }

Property Value

VBType