CaseDataLoweredValue

scalus.compiler.sir.lowering.CaseDataLoweredValue
case class CaseDataLoweredValue(scrutinee: LoweredValue, constrTagVar: IdentifiableLoweredValue, constrArgsVar: IdentifiableLoweredValue, constrBranch: LoweredValue, mapEntriesVar: IdentifiableLoweredValue, mapBranch: LoweredValue, listElementsVar: IdentifiableLoweredValue, listBranch: LoweredValue, iValueVar: IdentifiableLoweredValue, iBranch: LoweredValue, bValueVar: IdentifiableLoweredValue, bBranch: LoweredValue, tp: SIRType, repr: LoweredValueRepresentation, inPos: SIRPosition) extends ComplexLoweredValue

LoweredValue for Case on Data (PlutusV4+).

Data has 5 constructors with different bound variables:

  • Constr (index 0): receives tag (Integer) and args (List[Data])
  • Map (index 1): receives entries (List[(Data, Data)])
  • List (index 2): receives elements (List[Data])
  • I (index 3): receives value (Integer)
  • B (index 4): receives value (ByteString)

Each branch is a lambda that receives the appropriate arguments.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def docDef(ctx: PrettyPrintingContext): Doc

Pretty print this value with all definitona

Pretty print this value with all definitona

Value parameters

style
  • style of printing

Attributes

Definition Classes
override def pos: SIRPosition

Attributes

Definition Classes

The type of representation of this value.

The type of representation of this value.

Attributes

Definition Classes
override def sirType: SIRType

Attributes

Definition Classes
override def termInternal(gctx: TermGenerationContext): Term

Generates the term for this value.

Generates the term for this value.

Attributes

Definition Classes

Inherited methods

override def addDependent(value: IdentifiableLoweredValue): Unit

add identifiable variable to be updated from this variable

add identifiable variable to be updated from this variable

Attributes

Definition Classes
Inherited from:
ComplexLoweredValue
override def docRef(ctx: PrettyPrintingContext): Doc

Pretty print reference to value

Pretty print reference to value

Value parameters

style
  • style of printing

Attributes

Definition Classes
Inherited from:
ComplexLoweredValue
override def findSelfOrSubtems(p: LoweredValue => Boolean): Option[LoweredValue]

Attributes

Definition Classes
Inherited from:
ComplexLoweredValue

Internal variables, that are used inside this value.

Internal variables, that are used inside this value.

Attributes

Definition Classes
Inherited from:
ComplexLoweredValue
def isConstant: Boolean

Whether this value is (or wraps) a compile-time constant. Propagates through proxies and variable bindings.

Whether this value is (or wraps) a compile-time constant. Propagates through proxies and variable bindings.

Attributes

Inherited from:
LoweredValue
override def isEffortLess: Boolean

Is this value effort-less to compute (i.e. constant or variable or lambda)

Is this value effort-less to compute (i.e. constant or variable or lambda)

Attributes

Definition Classes
Inherited from:
ComplexLoweredValue
def maybeUpcast(targetType: SIRType, pos: SIRPosition)(using lctx: LoweringContext): LoweredValue

Upcast the value to the target type if needed.

Upcast the value to the target type if needed.

Also reconciles the value's representation with any uplcRepr annotation on the target type. Even if structural unification succeeds (annotations are stripped by SIRUnify), the target may declare a representation hint that this value's actual representation doesn't satisfy — in that case, convert via toRepresentation so the returned value's type and repr stay consistent for downstream consumers.

Attributes

Inherited from:
LoweredValue
def pretty: Doc

Attributes

Inherited from:
LoweredValue
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Attributes

Inherited from:
ComplexLoweredValue
def shortShow: String

Attributes

Inherited from:
LoweredValue
def show: String

Attributes

Inherited from:
LoweredValue

The UPLC term that represents this value, wrapped in vars if needed.

The UPLC term that represents this value, wrapped in vars if needed.

Value parameters

gctx
  • context for term generation

Attributes

Returns

generated term wrapped in lambdas with definition of needed uplevel variables

Inherited from:
LoweredValue

Convert this value to the given representation.

Convert this value to the given representation.

Routes through SumDispatch.toRepresentation, which inspects the source value's actual typegen and dispatches accordingly (Sum-side typegens go through the centralized toRepresentationImpl helpers; non-Sum typegens fall back to their direct toRepresentation). We can't split by SIRType.isSum/isProd here because sum-shaped constructors have CaseClass SIR types (e.g. List.Cons is a CaseClass whose typegen is SumBuiltinList).

Attributes

Inherited from:
LoweredValue
def upcastOne(targetType: SIRType, pos: SIRPosition)(using lctx: LoweringContext): LoweredValue

Attributes

Inherited from:
LoweredValue

Uplevel variables, that are used in this value.

Uplevel variables, that are used in this value.

Attributes

Definition Classes
Inherited from:
ComplexLoweredValue

Inherited fields

Attributes

Inherited from:
ComplexLoweredValue

Attributes

Inherited from:
ComplexLoweredValue
val createdEx: RuntimeException

Attributes

Inherited from:
LoweredValue
var debugMark: String

Attributes

Inherited from:
LoweredValue

Uplevel variables, that should be generated before generation of term

Uplevel variables, that should be generated before generation of term

Attributes

Inherited from:
ComplexLoweredValue
override val ownVars: Set[IdentifiableLoweredValue]

Variables, that are directly defined in this value.

Variables, that are directly defined in this value.

Attributes

Inherited from:
ComplexLoweredValue

Attributes

Inherited from:
ComplexLoweredValue