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
Members list
In this article