This one is not exactly related to Compose, howeve...
# compose
b
This one is not exactly related to Compose, however, I'm having issues with the latest AS canary + collections. Canary 13 + Kotlin 1.4.0 = I can use the standard Kotlin
emptyList()
Canary 13 + Kotlin 1.4.10 = forces me to import
java.util.Collections.emptyList
, does not allow me to reference the standard one. (sorry, I do not know if this was happening in previous canary versions. I have just updated to Kotlin 1.4.10 to test alpha04) P.S.: I tested Kotlin 1.4.10 in stable AS and in IDEA, no issues there.
g
does not allow me to reference the standard one.
What do you mean? is it not building and show as unresolved?
b
Yes, it is not building. 1. Autocomplete suggests me to import Java collection (
java.util.Collections.emptyList
). 2. If I try to do
import kotlin.collections
manually, I get this error:
g
you cannot import package
it’s valid error
import kotlin.collections.* - this is valid syntax
and anyway emptyList() doesn’t require import, it imported by defaulk
b
Oh I totally missed the .*, you're right! I don't get the import error, but still does not recognize it...
However yes - that's exactly the problem. My existing code had no import because it should not be needed. However, now it's not recognizing it 😕 forces me to import
(brand new project created in latest Canary, using kotlin 1.4.10)
g
as usual in such cases “Invalidate caches and restart” 🤷
j
I have the same, also after invalidating caches and restart, but only in Android Studio and not in Idea