When the file contains only a single class/interface/etc declaration that matches the name of the file, then it displays the file by its type.
For example, the following Question.kt file would display the class icon and name Question
data class Question(@StringRes val textResId: Int, val answer: Boolean)
But the following will display the Kotlin icon and the name Question.kt
private const val DEFAULT_ANSWER = false
data class Question(@StringRes val textRedId: Int, val answer: Boolean = DEFAULT_ANSWER)
because this latter example has two declarations: