ScalaFile

zio.blocks.codegen.ir.ScalaFile
final case class ScalaFile(packageDecl: PackageDecl, imports: List[Import] = ..., types: List[TypeDefinition] = ...)

Represents a complete Scala source file in the IR.

A Scala file consists of a package declaration, optional imports, and type definitions. This is the top-level IR node for code generation.

Value parameters

imports

The import statements (defaults to empty list)

packageDecl

The package declaration for this file

types

The type definitions in this file (defaults to empty list)

Attributes

Example
val file = ScalaFile(
 PackageDecl("com.example"),
 imports = List(
   Import.SingleImport("scala.collection", "List"),
   Import.WildcardImport("zio")
 ),
 types = List(
   CaseClass("Person", List(Field("name", TypeRef.String)))
 )
)
Source
ScalaFile.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala