# Kotlin 2.x `by lazy` in companion objects

## Problem

Under Kotlin 2.x, `by lazy` on a `val` inside a `companion object` fails with:
```
Property delegate must have a 'getValue(Companion, KProperty1<Companion, String>)' method
Cannot infer type for this parameter
```

```kotlin
// BROKEN
companion object {
    private val FOO: String by lazy { BuildConfig.SOME_FIELD }
}
```

## Fix

Convert to a computed property using `get()`:

```kotlin
// FIXED
companion object {
    private val FOO: String get() = BuildConfig.SOME_FIELD
}
```

This is equivalent — both are lazily evaluated on first access. The `get()` form avoids the Kotlin 2.x companion object delegate inference issue.

## When it hits

Most commonly when referencing `BuildConfig` fields inside companion objects in Android projects. Also occurs with any `by lazy` that the compiler can't type-infer in companion scope.
