IrMemberAccessExpression::getTypeArgument

This commit is contained in:
Dmitry Petrov
2016-09-19 13:30:09 +03:00
committed by Dmitry Petrov
parent 89de2a2ebe
commit 7ae6c55ddb
36 changed files with 219 additions and 71 deletions
@@ -72,6 +72,7 @@ FILE /classLevelProperties.kt
FIELD DELEGATE val `test7$delegate`: kotlin.Lazy<kotlin.Int>
EXPRESSION_BODY
CALL 'lazy(() -> Int): Lazy<Int>' type=kotlin.Lazy<kotlin.Int> origin=null
<T>: Int
initializer: BLOCK type=() -> kotlin.Int origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(): kotlin.Int
BLOCK_BODY
@@ -82,6 +83,7 @@ FILE /classLevelProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test7>(): Int'
CALL 'getValue(Any?, KProperty<*>) on Lazy<Int>: Int' type=kotlin.Int origin=null
<T>: Int
$receiver: GET_FIELD '`test7$delegate`: Lazy<Int>' type=kotlin.Lazy<kotlin.Int> origin=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
@@ -90,10 +92,13 @@ FILE /classLevelProperties.kt
FIELD DELEGATE val `test8$delegate`: java.util.HashMap<kotlin.String, kotlin.Int>
EXPRESSION_BODY
CALL 'hashMapOf(vararg Pair<String, Int>): HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
<K>: String
<V>: Int
FUN DELEGATED_PROPERTY_ACCESSOR public final fun <get-test8>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test8>(): Int'
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Int>: Int' type=kotlin.Int origin=null
<V>: Int
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
@@ -102,6 +107,7 @@ FILE /classLevelProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<set-test8>(Int): Unit'
CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap<in String, in Int>: Unit' type=kotlin.Unit origin=null
<V>: Int
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
@@ -3,6 +3,7 @@ FILE /delegatedProperties.kt
FIELD DELEGATE val `test1$delegate`: kotlin.Lazy<kotlin.Int>
EXPRESSION_BODY
CALL 'lazy(() -> Int): Lazy<Int>' type=kotlin.Lazy<kotlin.Int> origin=null
<T>: Int
initializer: BLOCK type=() -> kotlin.Int origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(): kotlin.Int
BLOCK_BODY
@@ -13,6 +14,7 @@ FILE /delegatedProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test1>(): Int'
CALL 'getValue(Any?, KProperty<*>) on Lazy<Int>: Int' type=kotlin.Int origin=null
<T>: Int
$receiver: GET_FIELD '`test1$delegate`: Lazy<Int>' type=kotlin.Lazy<kotlin.Int> origin=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE 'test1: Int' type=kotlin.reflect.KProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
@@ -34,6 +36,7 @@ FILE /delegatedProperties.kt
FIELD DELEGATE val `test2$delegate`: kotlin.Lazy<kotlin.Int>
EXPRESSION_BODY
CALL 'lazy(() -> Int): Lazy<Int>' type=kotlin.Lazy<kotlin.Int> origin=null
<T>: Int
initializer: BLOCK type=() -> kotlin.Int origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(): kotlin.Int
BLOCK_BODY
@@ -44,6 +47,7 @@ FILE /delegatedProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test2>(): Int'
CALL 'getValue(Any?, KProperty<*>) on Lazy<Int>: Int' type=kotlin.Int origin=null
<T>: Int
$receiver: GET_FIELD '`test2$delegate`: Lazy<Int>' type=kotlin.Lazy<kotlin.Int> origin=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
@@ -57,6 +61,7 @@ FILE /delegatedProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test3>(): Any'
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Any>: Any' type=kotlin.Any origin=null
<V>: Any
$receiver: GET_FIELD '`test3$delegate`: MutableMap<String, Any>' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> origin=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
@@ -65,6 +70,7 @@ FILE /delegatedProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<set-test3>(Any): Unit'
CALL 'setValue(Any?, KProperty<*>, Any) on MutableMap<in String, in Any>: Unit' type=kotlin.Unit origin=null
<V>: Any
$receiver: GET_FIELD '`test3$delegate`: MutableMap<String, Any>' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> origin=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
@@ -74,10 +80,13 @@ FILE /delegatedProperties.kt
FIELD DELEGATE val `test4$delegate`: java.util.HashMap<kotlin.String, kotlin.Any>
EXPRESSION_BODY
CALL 'hashMapOf(vararg Pair<String, Any>): HashMap<String, Any>' type=java.util.HashMap<kotlin.String, kotlin.Any> origin=null
<K>: String
<V>: Any
FUN DELEGATED_PROPERTY_ACCESSOR public fun <get-test4>(): kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test4>(): Any'
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Any>: Any' type=kotlin.Any origin=null
<V>: Any
$receiver: GET_FIELD '`test4$delegate`: HashMap<String, Any>' type=java.util.HashMap<kotlin.String, kotlin.Any> origin=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE 'test4: Any' type=kotlin.reflect.KMutableProperty0<kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE
@@ -85,6 +94,7 @@ FILE /delegatedProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<set-test4>(Any): Unit'
CALL 'setValue(Any?, KProperty<*>, Any) on MutableMap<in String, in Any>: Unit' type=kotlin.Unit origin=null
<V>: Any
$receiver: GET_FIELD '`test4$delegate`: HashMap<String, Any>' type=java.util.HashMap<kotlin.String, kotlin.Any> origin=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE 'test4: Any' type=kotlin.reflect.KMutableProperty0<kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE
@@ -4,6 +4,7 @@ FILE /localDelegatedProperties.kt
LOCAL_DELEGATED_PROPERTY val x: kotlin.Int
VAR DELEGATE val `x$delegate`: kotlin.Lazy<kotlin.Int>
CALL 'lazy(() -> Int): Lazy<Int>' type=kotlin.Lazy<kotlin.Int> origin=null
<T>: Int
initializer: BLOCK type=() -> kotlin.Int origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(): kotlin.Int
BLOCK_BODY
@@ -14,6 +15,7 @@ FILE /localDelegatedProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
CALL 'getValue(Any?, KProperty<*>) on Lazy<Int>: Int' type=kotlin.Int origin=null
<T>: Int
$receiver: GET_VAR '`x$delegate`: Lazy<Int>' type=kotlin.Lazy<kotlin.Int> origin=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE 'x: Int' type=kotlin.reflect.KProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
@@ -24,10 +26,13 @@ FILE /localDelegatedProperties.kt
LOCAL_DELEGATED_PROPERTY var x: kotlin.Int
VAR DELEGATE val `x$delegate`: java.util.HashMap<kotlin.String, kotlin.Int>
CALL 'hashMapOf(vararg Pair<String, Int>): HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
<K>: String
<V>: Int
FUN DELEGATED_PROPERTY_ACCESSOR local final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Int>: Int' type=kotlin.Int origin=null
<V>: Int
$receiver: GET_VAR '`x$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE 'x: Int' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
@@ -36,6 +41,7 @@ FILE /localDelegatedProperties.kt
RETURN type=kotlin.Nothing from='<set-x>(Int): Int'
TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Int
CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap<in String, in Int>: Unit' type=kotlin.Unit origin=null
<V>: Int
$receiver: GET_VAR '`x$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE 'x: Int' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
@@ -60,6 +60,7 @@ FILE /packageLevelProperties.kt
FIELD DELEGATE val `test7$delegate`: kotlin.Lazy<kotlin.Int>
EXPRESSION_BODY
CALL 'lazy(() -> Int): Lazy<Int>' type=kotlin.Lazy<kotlin.Int> origin=null
<T>: Int
initializer: BLOCK type=() -> kotlin.Int origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(): kotlin.Int
BLOCK_BODY
@@ -70,6 +71,7 @@ FILE /packageLevelProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test7>(): Int'
CALL 'getValue(Any?, KProperty<*>) on Lazy<Int>: Int' type=kotlin.Int origin=null
<T>: Int
$receiver: GET_FIELD '`test7$delegate`: Lazy<Int>' type=kotlin.Lazy<kotlin.Int> origin=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE 'test7: Int' type=kotlin.reflect.KProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
@@ -77,10 +79,13 @@ FILE /packageLevelProperties.kt
FIELD DELEGATE val `test8$delegate`: java.util.HashMap<kotlin.String, kotlin.Int>
EXPRESSION_BODY
CALL 'hashMapOf(vararg Pair<String, Int>): HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
<K>: String
<V>: Int
FUN DELEGATED_PROPERTY_ACCESSOR public fun <get-test8>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test8>(): Int'
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Int>: Int' type=kotlin.Int origin=null
<V>: Int
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
@@ -88,6 +93,7 @@ FILE /packageLevelProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<set-test8>(Int): Unit'
CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap<in String, in Int>: Unit' type=kotlin.Unit origin=null
<V>: Int
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test1(x: Any) =
x is Array<*> && x.isArrayOf<String>()
@@ -0,0 +1,12 @@
FILE /typeArguments.kt
FUN public fun test1(x: kotlin.Any): kotlin.Boolean
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1(Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
if: TYPE_OP origin=INSTANCEOF typeOperand=kotlin.Array<*>
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: CALL 'isArrayOf() on Array<*>: Boolean' type=kotlin.Boolean origin=null
<reified T : Any>: String
$receiver: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Array<*>
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
else: CONST Boolean type=kotlin.Boolean value='false'
+3
View File
@@ -3,6 +3,7 @@ FILE /vararg.kt
FIELD PROPERTY_BACKING_FIELD public val test1: kotlin.Array<kotlin.String>
EXPRESSION_BODY
CALL 'arrayOf(vararg String): Array<String>' type=kotlin.Array<kotlin.String> origin=null
<reified T>: String
FUN DEFAULT_PROPERTY_ACCESSOR public fun <get-test1>(): kotlin.Array<kotlin.String>
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test1>(): Array<String>'
@@ -11,6 +12,7 @@ FILE /vararg.kt
FIELD PROPERTY_BACKING_FIELD public val test2: kotlin.Array<kotlin.String>
EXPRESSION_BODY
CALL 'arrayOf(vararg String): Array<String>' type=kotlin.Array<kotlin.String> origin=null
<reified T>: String
elements: VARARG type=Array<out String> varargElementType=String
CONST String type=kotlin.String value='1'
CONST String type=kotlin.String value='2'
@@ -23,6 +25,7 @@ FILE /vararg.kt
FIELD PROPERTY_BACKING_FIELD public val test3: kotlin.Array<kotlin.String>
EXPRESSION_BODY
CALL 'arrayOf(vararg String): Array<String>' type=kotlin.Array<kotlin.String> origin=null
<reified T>: String
elements: VARARG type=Array<out String> varargElementType=String
CONST String type=kotlin.String value='0'
SPREAD_ELEMENT
+4
View File
@@ -23,7 +23,9 @@ FILE /when.kt
GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
then: CONST String type=kotlin.String value='String'
if: CALL 'contains(Any) on Iterable<Any>: Boolean' type=kotlin.Boolean origin=IN
<T>: Any
$receiver: CALL 'setOf(): Set<Nothing>' type=kotlin.collections.Set<kotlin.Nothing> origin=null
<T>: Nothing
element: GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
then: CONST String type=kotlin.String value='nothingness?'
else: CONST String type=kotlin.String value='something'
@@ -43,7 +45,9 @@ FILE /when.kt
GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
then: CONST String type=kotlin.String value='String'
if: CALL 'contains(Any) on Iterable<Any>: Boolean' type=kotlin.Boolean origin=IN
<T>: Any
$receiver: CALL 'setOf(): Set<Nothing>' type=kotlin.collections.Set<kotlin.Nothing> origin=null
<T>: Nothing
element: GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
then: CONST String type=kotlin.String value='nothingness?'
else: CONST String type=kotlin.String value='something'
@@ -3,6 +3,8 @@ FILE /extensionLambda.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1(): Int'
CALL 'run(String.() -> Int) on String: Int' type=kotlin.Int origin=null
<T>: String
<R>: Int
$receiver: CONST String type=kotlin.String value='42'
block: BLOCK type=kotlin.String.() -> kotlin.Int origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun kotlin.String.<anonymous>(): kotlin.Int
@@ -23,18 +23,24 @@ FILE /multipleImplicitReceivers.kt
FUN public fun test(fooImpl: IFoo, invokeImpl: IInvoke): kotlin.Unit
BLOCK_BODY
CALL 'with(A, A.() -> Int): Int' type=kotlin.Int origin=null
<T>: A
<R>: Int
receiver: GET_OBJECT 'A' type=A
block: BLOCK type=A.() -> kotlin.Int origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun A.<anonymous>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<anonymous>() on A: Int'
CALL 'with(IFoo, IFoo.() -> Int): Int' type=kotlin.Int origin=null
<T>: IFoo
<R>: Int
receiver: GET_VAR 'value-parameter fooImpl: IFoo' type=IFoo origin=null
block: BLOCK type=IFoo.() -> kotlin.Int origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun IFoo.<anonymous>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<anonymous>() on IFoo: Int'
CALL 'with(IInvoke, IInvoke.() -> Int): Int' type=kotlin.Int origin=null
<T>: IInvoke
<R>: Int
receiver: GET_VAR 'value-parameter invokeImpl: IInvoke' type=IInvoke origin=null
block: BLOCK type=IInvoke.() -> kotlin.Int origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun IInvoke.<anonymous>(): kotlin.Int
@@ -2,6 +2,7 @@ FILE /nonLocalReturn.kt
FUN public fun test0(): kotlin.Unit
BLOCK_BODY
CALL 'run(() -> Nothing): Nothing' type=kotlin.Nothing origin=null
<R>: Nothing
block: BLOCK type=() -> kotlin.Nothing origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(): kotlin.Nothing
BLOCK_BODY
@@ -10,6 +11,7 @@ FILE /nonLocalReturn.kt
FUN public fun test1(): kotlin.Unit
BLOCK_BODY
CALL 'run(() -> Unit): Unit' type=kotlin.Unit origin=null
<R>: Unit
block: BLOCK type=() -> kotlin.Unit origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(): kotlin.Unit
BLOCK_BODY
@@ -18,6 +20,7 @@ FILE /nonLocalReturn.kt
FUN public fun test2(): kotlin.Unit
BLOCK_BODY
CALL 'run(() -> Unit): Unit' type=kotlin.Unit origin=null
<R>: Unit
block: BLOCK type=() -> kotlin.Unit origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(): kotlin.Unit
BLOCK_BODY
@@ -26,6 +29,7 @@ FILE /nonLocalReturn.kt
FUN public fun testLrmFoo1(ints: kotlin.collections.List<kotlin.Int>): kotlin.Unit
BLOCK_BODY
CALL 'forEach((Int) -> Unit) on Iterable<Int>: Unit' type=kotlin.Unit origin=null
<T>: Int
$receiver: GET_VAR 'value-parameter ints: List<Int>' type=kotlin.collections.List<kotlin.Int> origin=null
action: BLOCK type=(kotlin.Int) -> kotlin.Unit origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(it: kotlin.Int): kotlin.Unit
@@ -42,6 +46,7 @@ FILE /nonLocalReturn.kt
FUN public fun testLrmFoo2(ints: kotlin.collections.List<kotlin.Int>): kotlin.Unit
BLOCK_BODY
CALL 'forEach((Int) -> Unit) on Iterable<Int>: Unit' type=kotlin.Unit origin=null
<T>: Int
$receiver: GET_VAR 'value-parameter ints: List<Int>' type=kotlin.collections.List<kotlin.Int> origin=null
action: BLOCK type=(kotlin.Int) -> kotlin.Unit origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(it: kotlin.Int): kotlin.Unit