Fix false positive for type error in intentions AddReturnTo...

Relates to #KT-25272
This commit is contained in:
Dmitry Gridin
2019-03-14 10:43:23 +07:00
parent d7ce24410d
commit 179dfce3a8
7 changed files with 74 additions and 4 deletions
@@ -0,0 +1,10 @@
// "Add 'return' to last expression" "false"
// WITH_RUNTIME
// ACTION: Introduce local variable
// ACTION: Remove explicitly specified return type of enclosing function 'some'
// ERROR: A 'return' expression required in a function with a block body ('{...}')
// ERROR: Unresolved reference: FunctionReference
fun some(): FunctionReference {
Int::class
}<caret>
@@ -0,0 +1,10 @@
// "Add 'return' to last expression" "false"
// WITH_RUNTIME
// ACTION: Introduce local variable
// ACTION: Remove explicitly specified return type of enclosing function 'some'
// ERROR: A 'return' expression required in a function with a block body ('{...}')
// ERROR: Unresolved reference: FunctionReference
fun some(): Any {
FunctionReference::class
}<caret>
@@ -0,0 +1,10 @@
// "Add 'return' before the expression" "false"
// WITH_RUNTIME
// ACTION: Introduce import alias
// ACTION: Introduce local variable
// ERROR: A 'return' expression required in a function with a block body ('{...}')
// ERROR: Unresolved reference: FunctionReference
fun some(): FunctionReference {
Int<caret>::class
}
@@ -0,0 +1,17 @@
// "Add 'return' before the expression" "false"
// WITH_RUNTIME
// ACTION: Create local variable 'FunctionReference'
// ACTION: Create object 'FunctionReference'
// ACTION: Create parameter 'FunctionReference'
// ACTION: Create property 'FunctionReference'
// ACTION: Create annotation 'FunctionReference'
// ACTION: Create class 'FunctionReference'
// ACTION: Create enum 'FunctionReference'
// ACTION: Create interface 'FunctionReference'
// ACTION: Introduce local variable
// ACTION: Rename reference
// ERROR: Unresolved reference: FunctionReference
fun some() {
FunctionReference<caret>::class
}