Fix methods inherited from Any in interop value types

This commit is contained in:
Svyatoslav Scherbina
2017-03-15 16:48:39 +07:00
committed by SvyatoslavScherbina
parent d1859dd280
commit c9b04bc0bb
7 changed files with 32 additions and 3 deletions
@@ -27,9 +27,12 @@ class NativePointedBox(val value: NativePointed) {
return this.value == other.value
}
override fun hashCode() = value.hashCode()
// TODO: can't delegate the following methods to `this.value`
// because `NativePointed` doesn't provide them.
override fun toString() = value.toString()
override fun hashCode() = this.value.rawPtr.hashCode()
override fun toString() = "NativePointed(raw=${this.value.rawPtr})"
}
fun boxNativePointed(value: NativePointed?) = if (value != null) NativePointedBox(value) else null