Don't run analysis in SpecifyTypeExplicitlyIntention.isAvailable()
If type is invalid, show error hint when action is invoked
This commit is contained in:
+2
-1
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user