Compiler
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Compiler.type
Members list
Type members
Classlikes
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Types
Value members
Concrete methods
Compiles the given expression to a SIR at compile time using the Scalus compiler plugin.
Compiles the given expression to a SIR at compile time using the Scalus compiler plugin.
Value parameters
- e
-
The expression to compile.
Attributes
- Returns
-
The compiled SIR.
- Example
-
val sir = Compiler.compile(true) // Compiles the expression `true` to a SIR val uplc = sir.toUplc() // Converts the SIR to UPLC
Compiles the given expression to a SIR at compile time using the Scalus compiler plugin, producing debug output during the compilation.
Compiles the given expression to a SIR at compile time using the Scalus compiler plugin, producing debug output during the compilation.
Value parameters
- e
-
The expression to compile.
Attributes
- Returns
-
The compiled SIR.
Generates a Compiler.compile(code)
call at compile time.
Generates a Compiler.compile(code)
call at compile time.
When you want to use Compiler.compile in an inline method you can't do it directly, because the Scalus compiler plugin finds the call to Compiler.compile
and replaces it with the compiled code. Which is not what you want in this case!
For example this will not work:
inline def myTest(inline code: Any): SIR = {
Compiler.compile(code).toUplc().evaluate
}
Instead, you should use this method:
inline def myTest(inline code: Any): SIR = {
Compiler.compileInline(code).toUplc().evaluate
}
Attributes
Compiles the given expression to a SIRType at compile time using the Scalus compiler plugin.
Compiles the given expression to a SIRType at compile time using the Scalus compiler plugin.
Type parameters
- T
-
The type to compile.
Attributes
- Returns
-
The compiled SIRType.
- Example
-
// Compiles the type `BigInt` to a SIRType.Integer val sirType = Compiler.compileType[BigInt]