Having the following code:
fun doSomething(): List { val test: List<*> = arrayListOf(\"test1\", \"test2\") return test as List&
Adding @Suppress("UNCHECKED_CAST") (also possible through IDEA's Alt+Enter menu) to any of statement, function, class and file should help.
@Suppress("UNCHECKED_CAST")
Before:
After: