Files
kotlin/idea/testData/android/lintQuickfix/targetVersionCheck/destructuringDeclaration.kt.expected
Vyacheslav Gerasimov 15bfd4439a Fix AddTargetVersionCheckQuickFix, generate else branch with TODO
when surrounded statement used as expression

#KT-17786 Fixed
#KT-17788 Fixed
2017-06-06 20:46:53 +03:00

17 lines
601 B
Plaintext
Vendored

// INTENTION_TEXT: Surround with if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { ... }
// INSPECTION_CLASS: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintNewApiInspection
import android.app.Activity
import android.graphics.drawable.VectorDrawable
import android.os.Build
data class ValueProvider(var p1: VectorDrawable, val p2: Int)
val activity = Activity()
fun foo() {
val (v1, v2) = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ValueProvider(VectorDrawable(), 0)
} else {
TODO("VERSION.SDK_INT < LOLLIPOP")
}
}