From e479956f575dacd31af065cf16b3c3d04f1f55bf Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 18 Dec 2014 19:40:24 +0300 Subject: [PATCH] Note in specs about replacing reified TP with primitives --- spec-docs/reified-type-parameters.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec-docs/reified-type-parameters.md b/spec-docs/reified-type-parameters.md index f986f629f4f..ab299767b2a 100644 --- a/spec-docs/reified-type-parameters.md +++ b/spec-docs/reified-type-parameters.md @@ -45,6 +45,7 @@ Notes: ## Implementation notes for the JVM In inline functions, occurrences of a `reified` type parameter `T` are replaced with the actual type argument. +If actual type argument is a primitive type, it's wrapper will be used within reified bytecode. ``` kotlin open class TypeLiteral { @@ -55,6 +56,7 @@ open class TypeLiteral { inline fun typeLiteral(): TypeLiteral = object : TypeLiteral() {} // here T is replaced with the actual type typeLiteral().type // returns 'class java.lang.String' +typeLiteral().type // returns 'class java.lang.Integer' typeLiteral>().type // returns '[Ljava.lang.String;' typeLiteral>().type // returns 'java.util.List' ```