Don't run analysis in SpecifyTypeExplicitlyIntention.isAvailable()

If type is invalid, show error hint when action is invoked
This commit is contained in:
Dmitry Jemerov
2018-03-29 16:12:44 +02:00
parent 6d9457853e
commit a495c2e5ea
9 changed files with 50 additions and 16 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
// "Specify type explicitly" "false"
// "Specify type explicitly" "true"
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
// ACTION: Add getter
// ACTION: Convert property to function
// ACTION: Introduce backing property
@@ -0,0 +1,12 @@
// "Specify type explicitly" "true"
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
// ACTION: Add getter
// ACTION: Convert property to function
// ACTION: Introduce backing property
// ACTION: Move to companion object
// ACTION: Move to constructor
// ERROR: Unresolved reference: foo
class A() {
public val <caret>t = foo()
}
@@ -1,4 +1,5 @@
// "Specify type explicitly" "false"
// "Specify type explicitly" "true"
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
// ERROR: This property must either have a type annotation, be initialized or be delegated
// ACTION: Convert member to extension
// ACTION: Convert property to function
@@ -0,0 +1,13 @@
// "Specify type explicitly" "true"
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
// ERROR: This property must either have a type annotation, be initialized or be delegated
// ACTION: Convert member to extension
// ACTION: Convert property to function
// ACTION: Move to companion object
class My {
val <caret>x
get() {
return 3.14
}
}
@@ -1,4 +1,5 @@
// "Specify type explicitly" "false"
// "Specify type explicitly" "true"
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
// ERROR: Type checking has run into a recursive problem. Easiest workaround: specify types of your declarations explicitly
// ACTION: Convert member to extension
// ACTION: Convert property to function
@@ -0,0 +1,11 @@
// "Specify type explicitly" "true"
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
// ERROR: Type checking has run into a recursive problem. Easiest workaround: specify types of your declarations explicitly
// ACTION: Convert member to extension
// ACTION: Convert property to function
// ACTION: Move to companion object
class A {
val a<caret>
get() = a
}