Quick-Fixes: Approximate non-denotable type with nearest denotable supertype
#KT-5915 Fixed
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// "Change 'bar' function return type to 'A'" "true"
|
||||
fun foo() {
|
||||
open class A
|
||||
|
||||
fun bar(): A {
|
||||
return object: A() {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Change parameter 't' type of function 'foo' to 'T'" "true"
|
||||
trait T
|
||||
|
||||
fun Int.foo(t: T) {
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
1.foo(object: T{})
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Change parameter 't' type of function 'foo' to 'T'" "true"
|
||||
trait T
|
||||
|
||||
fun Int.foo(t: T) = this
|
||||
|
||||
fun foo() {
|
||||
1 foo object: T{}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Change 't' type to 'T'" "true"
|
||||
trait T
|
||||
|
||||
fun foo() {
|
||||
val t: T = object: T{}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Change 'foo' function return type to 'T'" "true"
|
||||
trait T
|
||||
|
||||
fun foo(): T {
|
||||
return object: T{}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Change 'foo' function return type to 'Any'" "true"
|
||||
fun foo(): Any {
|
||||
class A
|
||||
|
||||
return A()
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Change 'foo' function return type to 'U'" "true"
|
||||
trait T
|
||||
trait U
|
||||
|
||||
fun foo(): U {
|
||||
open class A: T
|
||||
class B: A(), U
|
||||
|
||||
return <caret>B()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Change 'foo' function return type to 'T'" "true"
|
||||
trait T
|
||||
|
||||
fun foo(): T {
|
||||
open class A: T
|
||||
class B: A()
|
||||
|
||||
return B()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Change 'bar' function return type to 'A'" "true"
|
||||
fun foo() {
|
||||
open class A
|
||||
|
||||
fun bar(): Int {
|
||||
return <caret>object: A() {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Change parameter 't' type of function 'foo' to 'T'" "true"
|
||||
trait T
|
||||
|
||||
fun Int.foo(t: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
1.foo(<caret>object: T{})
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Change parameter 't' type of function 'foo' to 'T'" "true"
|
||||
trait T
|
||||
|
||||
fun Int.foo(t: Int) = this
|
||||
|
||||
fun foo() {
|
||||
1 foo <caret>object: T{}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Change 't' type to 'T'" "true"
|
||||
trait T
|
||||
|
||||
fun foo() {
|
||||
val t: Int = <caret>object: T{}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Change 'foo' function return type to 'T'" "true"
|
||||
trait T
|
||||
|
||||
fun foo() {
|
||||
return <caret>object: T{}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Change 'foo' function return type to 'Any'" "true"
|
||||
fun foo() {
|
||||
class A
|
||||
|
||||
return <caret>A()
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Change 'foo' function return type to 'U'" "true"
|
||||
trait T
|
||||
trait U
|
||||
|
||||
fun foo() {
|
||||
open class A: T
|
||||
class B: A(), U
|
||||
|
||||
return <caret>B()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Change 'foo' function return type to 'T'" "true"
|
||||
trait T
|
||||
|
||||
fun foo() {
|
||||
open class A: T
|
||||
class B: A()
|
||||
|
||||
return <caret>B()
|
||||
}
|
||||
Reference in New Issue
Block a user