KT-2193 Nullability information lost for functions inherited from traits
#KT-2193 fixed
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
//KT-2206
|
||||
trait A {
|
||||
fun f():Int = 239
|
||||
}
|
||||
|
||||
class B() : A
|
||||
|
||||
fun box() : String {
|
||||
return if (B().f() == 239) "OK" else "fail"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
//KT-2206
|
||||
|
||||
trait A {
|
||||
var a:Int
|
||||
get() = 239
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class B() : A
|
||||
|
||||
fun box() : String {
|
||||
return if (B().a == 239) "OK" else "fail"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
// test composed from KT-2193
|
||||
|
||||
trait A {
|
||||
open fun f(): String = "test"
|
||||
}
|
||||
|
||||
class B() : A
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace test
|
||||
|
||||
abstract trait test.A : jet.Any {
|
||||
open fun f(): jet.String
|
||||
}
|
||||
final class test.B : test.A {
|
||||
final /*constructor*/ fun <init>(): test.B
|
||||
open override /*1*/ fun f(): jet.String
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
// test composed from KT-2193
|
||||
|
||||
trait A {
|
||||
open var v: String
|
||||
get() = "test"
|
||||
set(value) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
class B() : A
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace test
|
||||
|
||||
abstract trait test.A : jet.Any {
|
||||
open var v: jet.String
|
||||
}
|
||||
final class test.B : test.A {
|
||||
final /*constructor*/ fun <init>(): test.B
|
||||
open var v: jet.String
|
||||
}
|
||||
Reference in New Issue
Block a user