New J2K: separate nullability inference from common one & nullability bug fixes
It will be needed for structure mutability inference #KT-21467 fixed #KT-32609 fixed #KT-32572 fixed #KT-24677 fixed
This commit is contained in:
@@ -11,6 +11,6 @@ internal class Test {
|
||||
fun nya(): Double {
|
||||
//TODO explicitlly call apply here
|
||||
|
||||
return foo(1, FunctionalI<Int, Double> { x: Int -> this.toDouble(x) })
|
||||
return foo(1, FunctionalI<Int?, Double?> { x: Int -> this.toDouble(x) })
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
// ERROR: Type mismatch: inferred type is B? but B was expected
|
||||
// ERROR: Unresolved reference: A
|
||||
// ERROR: Interface FunctionalI does not have constructors
|
||||
internal interface FunctionalI<A, B> {
|
||||
@@ -6,7 +5,7 @@ internal interface FunctionalI<A, B> {
|
||||
}
|
||||
|
||||
internal class Test {
|
||||
fun <A, B> foo(value: A, `fun`: FunctionalI<A?, B?>): B {
|
||||
fun <A, B> foo(value: A, `fun`: FunctionalI<A, B>): B {
|
||||
return `fun`.apply(value)
|
||||
}
|
||||
|
||||
@@ -15,6 +14,6 @@ internal class Test {
|
||||
}
|
||||
|
||||
fun nya(): Double {
|
||||
return foo(1, FunctionalI<Int, Double> { x: A -> this.toDouble(x) })
|
||||
return foo(1, FunctionalI<Int?, Double?> { x: A -> this.toDouble(x) })
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
fun <U> putU(u: U?) {}
|
||||
fun <U> putU(u: U) {}
|
||||
@@ -1 +1 @@
|
||||
fun <U, V, W> putUVW(u: U?, v: V?, w: W?) {}
|
||||
fun <U, V, W> putUVW(u: U, v: V, w: W) {}
|
||||
Reference in New Issue
Block a user