NI: Try to solve constraint system with another flexibility from a type variable if couldn't solve
^KT-36254 Fixed
This commit is contained in:
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
// Issue: KT-36254
|
||||
|
||||
// FILE: Convertor.java
|
||||
|
||||
public interface Convertor<Src, Dst> {
|
||||
Dst convert(Src o);
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun takeConvertor(c: Convertor<String, String>) {}
|
||||
|
||||
fun main() {
|
||||
takeConvertor(Convertor { null })
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
public fun main(): kotlin.Unit
|
||||
public fun takeConvertor(/*0*/ c: Convertor<kotlin.String, kotlin.String>): kotlin.Unit
|
||||
|
||||
public interface Convertor</*0*/ Src : kotlin.Any!, /*1*/ Dst : kotlin.Any!> {
|
||||
public abstract fun convert(/*0*/ o: Src!): Dst!
|
||||
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
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
// Issue: KT-36254
|
||||
|
||||
// FILE: Convertor.java
|
||||
|
||||
public interface Convertor<Src, Dst> {
|
||||
Out<Dst> convert(Out<Src> o);
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun takeConvertor(c: Convertor<String, String>) {}
|
||||
|
||||
class Out<out T> {}
|
||||
|
||||
fun main(o: Out<Nothing?>) {
|
||||
takeConvertor(Convertor { o })
|
||||
}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
package
|
||||
|
||||
public fun main(/*0*/ o: Out<kotlin.Nothing?>): kotlin.Unit
|
||||
public fun takeConvertor(/*0*/ c: Convertor<kotlin.String, kotlin.String>): kotlin.Unit
|
||||
|
||||
public interface Convertor</*0*/ Src : kotlin.Any!, /*1*/ Dst : kotlin.Any!> {
|
||||
public abstract fun convert(/*0*/ o: Out<Src!>!): Out<Dst!>!
|
||||
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 final class Out</*0*/ out T> {
|
||||
public constructor Out</*0*/ out 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
|
||||
}
|
||||
Reference in New Issue
Block a user