https://kotlinlang.org logo
#compose
Title
# compose
b

bruno.aybar

10/02/2020, 4:44 AM
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

gildor

10/02/2020, 4:58 AM
does not allow me to reference the standard one.
What do you mean? is it not building and show as unresolved?
b

bruno.aybar

10/02/2020, 5:10 AM
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

gildor

10/02/2020, 5:23 AM
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

bruno.aybar

10/02/2020, 5:29 AM
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

gildor

10/02/2020, 6:18 AM
as usual in such cases “Invalidate caches and restart” 🤷
j

Joost Klitsie

10/02/2020, 9:42 PM
I have the same, also after invalidating caches and restart, but only in Android Studio and not in Idea