Useful method moved to values.kt

This commit is contained in:
Andrey Breslav
2013-10-13 00:48:52 +04:00
parent d139856e4c
commit 6138902481
2 changed files with 8 additions and 8 deletions
+8 -1
View File
@@ -97,4 +97,11 @@ val Value.obj: Any?
return v
}
return (this as AbstractValue<*>).value
}
}
fun Any?.checkNull(): Any {
if (this == null) {
throw ThrownFromEvalException(ObjectValue(NullPointerException(), Type.getType(javaClass<NullPointerException>())))
}
return this
}
-7
View File
@@ -225,13 +225,6 @@ object REFLECTION_EVAL : Eval {
}
}
fun Any?.checkNull(): Any {
if (this == null) {
throw ThrownFromEvalException(ObjectValue(NullPointerException(), Type.getType(javaClass<NullPointerException>())))
}
return this
}
override fun getStaticField(fieldDesc: FieldDescription): Value {
val field = findStaticField(fieldDesc)