FIR IDE: introduce HLSpecifyExplicitTypeForCallableDeclarationIntention and HLRedundantUnitReturnTypeInspection

This commit is contained in:
Ilya Kirillov
2021-02-07 12:41:28 +01:00
parent a6f76399e2
commit 91e135888d
48 changed files with 706 additions and 67 deletions
@@ -1 +1,2 @@
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.RedundantUnitReturnTypeInspection
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.RedundantUnitReturnTypeInspection
// FIR_INSPECTION_CLASS: org.jetbrains.kotlin.idea.fir.inspections.declarations.HLRedundantUnitReturnTypeInspection
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.fir.intentions.declarations.HLSpecifyExplicitTypeForCallableDeclarationIntention
@@ -1,3 +1,4 @@
// IGNORE_FIR
class A {
private fun foo() <caret>= { object {} }
}
@@ -1,3 +1,4 @@
// IGNORE_FIR
class A {
private fun foo(): () -> Any<caret> = { object {} }
}
@@ -1,2 +1,3 @@
// IGNORE_FIR
class `1`
val x<caret> = `1`()
@@ -1,2 +1,3 @@
// IGNORE_FIR
class `1`
val x: `1` = `1`()
@@ -1,3 +1,4 @@
// IGNORE_FIR
// IS_APPLICABLE: false
val x = "<caret>"
@@ -1,3 +1,4 @@
// IGNORE_FIR
// WITH_RUNTIME
object Holder {
@@ -1,3 +1,4 @@
// IGNORE_FIR
// WITH_RUNTIME
object Holder {
@@ -1,3 +1,4 @@
// IGNORE_FIR
class A {
private fun bar() <caret>= {
class Local()
@@ -1,5 +1,6 @@
// IGNORE_FIR
class A {
private fun bar(): () -> Any<caret> = {
private fun bar(): () -> Any = {
class Local()
Local()
}
@@ -1,3 +1,4 @@
// IGNORE_FIR
open class F
class TestClass<V, out K>
@@ -1,3 +1,4 @@
// IGNORE_FIR
open class F
class TestClass<V, out K>
@@ -1,3 +1,4 @@
// IGNORE_FIR
// WITH_RUNTIME
import java.util.HashMap
@@ -1,3 +1,4 @@
// IGNORE_FIR
// WITH_RUNTIME
import java.util.HashMap
@@ -7,3 +7,5 @@ interface I {
class Test : I {
override fun foo()<caret> = null
}
// IGNORE_FIR
@@ -7,3 +7,5 @@ interface I {
class Test : I {
override fun foo(): String? = null
}
// IGNORE_FIR
@@ -1,3 +1,4 @@
// IGNORE_FIR
// CHOOSE_NULLABLE_TYPE_IF_EXISTS
// WITH_RUNTIME
interface Base {
@@ -1,3 +1,4 @@
// IGNORE_FIR
// CHOOSE_NULLABLE_TYPE_IF_EXISTS
// WITH_RUNTIME
interface Base {
@@ -1,3 +1,4 @@
// IGNORE_FIR
// CHOOSE_NULLABLE_TYPE_IF_EXISTS
// WITH_RUNTIME
interface Base {
@@ -1,3 +1,4 @@
// IGNORE_FIR
// CHOOSE_NULLABLE_TYPE_IF_EXISTS
// WITH_RUNTIME
interface Base {
@@ -1,3 +1,4 @@
// IGNORE_FIR
class String {}
val <caret>x = ""
@@ -1,5 +1,6 @@
import kotlin.String
// IGNORE_FIR
class String {}
val x: String = ""