[WASM] Any.toString implementation

This commit is contained in:
Igor Yakovlev
2022-01-18 16:00:35 +01:00
committed by teamcity
parent eb5df29834
commit c76e7bc9d8
+5 -2
View File
@@ -49,6 +49,9 @@ public open class Any {
/**
* Returns a string representation of the object.
*/
// TODO: Implement
public open fun toString(): String = "[Object object]"
public open fun toString(): String {
val typeData = getTypeInfoTypeDataByPtr(typeInfo)
val qualifiedName = if (typeData.packageName.isEmpty()) typeData.typeName else "${typeData.packageName}.${typeData.typeName}"
return "$qualifiedName@${hashCode()}"
}
}