There is after Kotlin conversion

Overview

I started Kotlin, so I'm writing notes. [If you can use Kotlin environment, [code]-[Convert Java File to Kotlin File]](https://www.jetbrains.com/help/idea/2017.1/converting-a-java-file-to-kotlin-file. html) It's relatively easy to convert to a Kotlin file. However, I made a collection of common bad know-how that cannot be converted ↓

environment

There is there

--Member variables that are not initialized get angry Solution → Initialize. Or unavoidably add lateinit.

--Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter [variable name] Solution → Change the type of [Variable name] to NullAble (add?) (Because I'm a former resident of the Java world, I'm okay with the NullAble default ...?)

Consideration

These days I've noticed that Kotlin Is the only tsundere tsundere.

bonus

-If you insert coroutine, you will get a warning like Warning: Ignoring Android API artifact com.google.android: android: at gradle: sync. .. Solution → Do this ↓

    compile ("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version") {
        exclude group: 'com.google.android', module: 'android'
    }

reference

-[What is!] Kotlin and Java, null and PlatformType [Not Null to Nullable]

Recommended Posts

There is after Kotlin conversion
What is object-oriented after all?
What is object-oriented after all?
Why Kotlin is so useful
WebSocket is now disconnected in 60 seconds after HTTPS conversion on AWS
Is there no type in Ruby?