optimization of toString for primitive types and "$expr"
- intrinsic toString for promitive types added to stdlib - utility method added to CodegenUtil - optimization logic added to generation of interpolating string
This commit is contained in:
@@ -9,3 +9,58 @@ public val <out T> T.javaClass : Class<T>
|
||||
[Intrinsic("kotlin.javaClass.property")] get() = (this as java.lang.Object).getClass() as Class<T>
|
||||
|
||||
[Intrinsic("kotlin.javaClass.function")] fun <out T> javaClass() : Class<T> = null as Class<T>
|
||||
|
||||
|
||||
/**
|
||||
* A helper method for calling hashCode() on Kotlin objects
|
||||
* TODO remove when Any supports equals() and hashCode()
|
||||
*/
|
||||
[Intrinsic("kotlin.hashCode")] public inline fun Any.hashCode(): Int = (this as java.lang.Object).hashCode()
|
||||
|
||||
/**
|
||||
* A helper method for calling toString() on Kotlin primitives
|
||||
* TODO remove when Any supports toString()
|
||||
*/
|
||||
[Intrinsic("kotlin.toString")] public fun Boolean.toString(): String = (null as String)
|
||||
|
||||
/**
|
||||
* A helper method for calling toString() on Kotlin primitives
|
||||
* TODO remove when Any supports toString()
|
||||
*/
|
||||
[Intrinsic("kotlin.toString")] public fun Byte.toString(): String = (null as String)
|
||||
|
||||
/**
|
||||
* A helper method for calling toString() on Kotlin primitives
|
||||
* TODO remove when Any supports toString()
|
||||
*/
|
||||
[Intrinsic("kotlin.toString")] public fun Short.toString(): String = (null as String)
|
||||
|
||||
/**
|
||||
* A helper method for calling toString() on Kotlin primitives
|
||||
* TODO remove when Any supports toString()
|
||||
*/
|
||||
[Intrinsic("kotlin.toString")] public fun Char.toString(): String = (null as String)
|
||||
|
||||
/**
|
||||
* A helper method for calling toString() on Kotlin primitives
|
||||
* TODO remove when Any supports toString()
|
||||
*/
|
||||
[Intrinsic("kotlin.toString")] public fun Int.toString(): String = (null as String)
|
||||
|
||||
/**
|
||||
* A helper method for calling toString() on Kotlin primitives
|
||||
* TODO remove when Any supports toString()
|
||||
*/
|
||||
[Intrinsic("kotlin.toString")] public fun Float.toString(): String = (null as String)
|
||||
|
||||
/**
|
||||
* A helper method for calling toString() on Kotlin primitives
|
||||
* TODO remove when Any supports toString()
|
||||
*/
|
||||
[Intrinsic("kotlin.toString")] public fun Long.toString(): String = (null as String)
|
||||
|
||||
/**
|
||||
* A helper method for calling toString() on Kotlin primitives
|
||||
* TODO remove when Any supports toString()
|
||||
*/
|
||||
[Intrinsic("kotlin.toString")] public fun Double.toString(): String = (null as String)
|
||||
|
||||
@@ -47,9 +47,3 @@ public inline fun <T> callable(action: ()-> T): Callable<T> {
|
||||
public override fun call() = action()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A helper method for calling hashCode() on Kotlin objects
|
||||
* TODO remove when Any supports equals() and hashCode()
|
||||
*/
|
||||
public inline fun Any.hashCode(): Int = (this as java.lang.Object).hashCode()
|
||||
|
||||
Reference in New Issue
Block a user