CLOVIS
03/20/2020, 1:19 PMobject Foo {
companion object {
suspend fun something(...)
}
}
When using auto completion to call Foo.something() in a non-suspending context (so it shouldn't be possible), IDEA will expand Foo.[caret] into Foo.Companion.something() then the ‘Redundant Companion reference' will kick in, and after removing the Companion. manually, only then will IDEA say ‘suspend function 'something' should be called from a coroutine [...]'
It would be much better if the message was shown during completion (eg. Type Foo., hit tab, see the list of functions with the suspending ones in orange with a message ‘cannot be called from outside a coroutine' or something similar).
IntelliJ Ultimate 2020.1, Kotlin 1.3.61