Fix for KT-14330 java.lang.IllegalArgumentException: Parameter specified as non-null is null: method ... parameter value

#KT-14330 Fixed
This commit is contained in:
Michael Bogdanov
2016-10-14 10:51:46 +03:00
parent fbe3f1537f
commit 050139220d
4 changed files with 35 additions and 1 deletions
@@ -0,0 +1,8 @@
data class Foo(var bar: Int?)
fun box(): String {
val receiver = Foo(1)
Foo::bar.set(receiver, null)
return if (receiver.bar == null) "OK" else "fail ${receiver.bar}"
}
@@ -0,0 +1,14 @@
var recivier : Any? = "fail"
var value2 : Any? = "fail2"
var <T> T.bar : T
get() = this
set(value) { recivier = this; value2 = value}
fun box(): String {
String?::bar.set(null, null)
if (recivier != null) "fail 1: ${recivier}"
if (value2 != null) "fail 2: ${value2}"
return "OK"
}