Note that there is a questionable behavior that will be fixed later. Right now it's not fully clear because for the same situation in Kotlin, the compiler reports warnings at declaration-site and it's not possible to do so for Java ^KT-53153