ala
val name = user.fullName
// java.lang.NullPointerException

val user = User("John", "Doe")
```

<br>

```scala mdoc:reset:invisible
case class User(firstName: String, lastName: String) {
  def fullName: String =
    s"${firstName} ${lastName}"
}
```

```scala mdoc
lazy val name = user.fullName

lazy val user = User("John", "Doe")

name
```

]

---
class: tiny-code

# Lazy Val code generation (Scala 3)

.twenty-two-left[
<br><br><br><br><br><br>
```scala
class Foo {
  lazy val bar = <RHS>
}
```
.center[
