'in' and '!in' operators.

This commit is contained in:
Dmitry Petrov
2016-08-17 17:21:33 +03:00
committed by Dmitry Petrov
parent 96e3c52878
commit 0d94c3aeb4
5 changed files with 131 additions and 47 deletions
+4
View File
@@ -0,0 +1,4 @@
fun test1(a: Any, x: Collection<Any>) = a in x
fun test2(a: Any, x: Collection<Any>) = a !in x
fun <T> test3(a: T, x: Collection<T>) = a in x
fun <T> test4(a: T, x: Collection<T>) = a !in x
+31
View File
@@ -0,0 +1,31 @@
IrFile /in.kt
IrFunction public fun test1(/*0*/ a: kotlin.Any, /*1*/ x: kotlin.collections.Collection<kotlin.Any>): kotlin.Boolean
IrExpressionBody
BLOCK type=<no-type> hasResult=false isDesugared=true
RETURN type=<no-type>
CALL .contains type=kotlin.Boolean operator=IN
$this: GET_VAR x type=kotlin.collections.Collection<kotlin.Any>
element: GET_VAR a type=kotlin.Any
IrFunction public fun test2(/*0*/ a: kotlin.Any, /*1*/ x: kotlin.collections.Collection<kotlin.Any>): kotlin.Boolean
IrExpressionBody
BLOCK type=<no-type> hasResult=false isDesugared=true
RETURN type=<no-type>
UNARY_OP operator=EXCL type=kotlin.Boolean related=null
CALL .contains type=kotlin.Boolean operator=NOT_IN
$this: GET_VAR x type=kotlin.collections.Collection<kotlin.Any>
element: GET_VAR a type=kotlin.Any
IrFunction public fun </*0*/ T> test3(/*0*/ a: T, /*1*/ x: kotlin.collections.Collection<T>): kotlin.Boolean
IrExpressionBody
BLOCK type=<no-type> hasResult=false isDesugared=true
RETURN type=<no-type>
CALL .contains type=kotlin.Boolean operator=IN
$this: GET_VAR x type=kotlin.collections.Collection<T>
element: GET_VAR a type=T
IrFunction public fun </*0*/ T> test4(/*0*/ a: T, /*1*/ x: kotlin.collections.Collection<T>): kotlin.Boolean
IrExpressionBody
BLOCK type=<no-type> hasResult=false isDesugared=true
RETURN type=<no-type>
UNARY_OP operator=EXCL type=kotlin.Boolean related=null
CALL .contains type=kotlin.Boolean operator=NOT_IN
$this: GET_VAR x type=kotlin.collections.Collection<T>
element: GET_VAR a type=T