NI: take into account flexible types during capturing arguments from expression
^KT-40544 Fixed
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNCHECKED_CAST
|
||||
|
||||
// FILE: Test.java
|
||||
class Test {
|
||||
static Foo<? extends Number> getFoo() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
class Foo<T>
|
||||
|
||||
fun <T> id(x: T) = null as T
|
||||
|
||||
fun test() {
|
||||
Test.getFoo()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Foo<out kotlin.Number..kotlin.Number?!>")!>id(Test.getFoo())<!>
|
||||
}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNCHECKED_CAST
|
||||
|
||||
// FILE: Test.java
|
||||
class Test {
|
||||
static Foo<? extends Number> getFoo() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
class Foo<T>
|
||||
|
||||
fun <T> id(x: T) = null as T
|
||||
|
||||
fun test() {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(Foo<out (kotlin.Number..kotlin.Number?)>..Foo<out (kotlin.Number..kotlin.Number?)>?)")!>Test.getFoo()<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(Foo<out (kotlin.Number..kotlin.Number?)>..Foo<out (kotlin.Number..kotlin.Number?)>?)")!>id(Test.getFoo())<!>
|
||||
}
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> id(/*0*/ x: T): T
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public final class Foo</*0*/ T> {
|
||||
public constructor Foo</*0*/ T>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public/*package*/ open class Test {
|
||||
public/*package*/ constructor Test()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public/*package*/ open fun getFoo(): Foo<out kotlin.Number!>!
|
||||
}
|
||||
Reference in New Issue
Block a user