Kotlin context-sensitive resolution uses an expected type, such as a when subject or declared variable type, to resolve a short name. A branch over Problem can write DATABASE instead of Problem.DATABASE.
The demo first establishes the expected type, then selects the matching name. This remains experimental in Kotlin 2.3 and needs a compiler option. Clashing declarations can make a short name ambiguous.
When to use
Use it to shorten enum and sealed branches, and qualify names when resolution is ambiguous.