How can I suppress unchecked cast warnings?

Adding @Suppress("UNCHECKED_CAST") (also possible through IDEA’s Alt+Enter menu) to any of statement, function, class and file should help.

Before:

enter image description here

After:

enter image description here

Leave a Comment