Adding @Suppress("UNCHECKED_CAST")
(also possible through IDEA’s Alt+Enter menu) to any of statement, function, class and file should help.
Before:
After:
More Related Contents:
- How to make clickable listview in android using kotlin
- What is a “receiver” in Kotlin?
- Kotlin and Immutable Collections?
- Kotlin’s Iterable and Sequence look exactly same. Why are two types required?
- How to check if a “lateinit” variable has been initialized?
- How to run Kotlin class from the command line?
- Is Kotlin “pass-by-value” or “pass-by-reference”?
- Kotlin static methods and variables
- Multiple variable let in Kotlin
- How can I detect a click with the view behind a Jetpack Compose Button?
- Example of when should we use run, let, apply, also and with on Kotlin
- How to create a fat JAR with Gradle Kotlin script?
- How to convert String to Int in Kotlin?
- Why does this Kotlin method have enclosing backticks?
- Why does mutableStateOf without remember work sometimes?
- How to make “inappropriate blocking method call” appropriate?
- IntArray vs Array in Kotlin
- How to clone object in Kotlin?
- Cross references in type parameters
- Swift ‘if let’ statement equivalent in Kotlin
- How do I initialize Kotlin’s MutableList to empty MutableList?
- warning: Kotlin runtime JAR files in the classpath should have the same version
- Difference between ArrayList() and mutableListOf() in Kotlin
- What’s the difference between !! and ? in Kotlin?
- How do I replace duplicate whitespaces in a String in Kotlin?
- Kotlin data class: how to read the value of property if I don’t know its name at compile time?
- Kotlin Foo::class.java “Unresolved Reference: Java” error
- kotlin program error: no main manifest attribute in jar file
- Configure Kotlin extension for Gradle subprojects
- Why do we use “companion object” as a kind of replacement for Java static fields in Kotlin?