Support all primitive literal types.

Apply simple unary operators to constants.
This commit is contained in:
Dmitry Petrov
2016-08-30 10:35:27 +03:00
committed by Dmitry Petrov
parent b3f605c4c4
commit fe46a02885
7 changed files with 65 additions and 19 deletions
@@ -7,8 +7,7 @@ FILE /simpleUnaryOperators.kt
FUN public fun test2(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from=test2
CALL .unaryMinus type=kotlin.Int operator=UMINUS
$this: CONST Int type=kotlin.Int value='42'
CONST Int type=kotlin.Int value='-42'
FUN public fun test3(/*0*/ x: kotlin.Int): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from=test3
@@ -17,8 +16,7 @@ FILE /simpleUnaryOperators.kt
FUN public fun test4(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from=test4
CALL .unaryPlus type=kotlin.Int operator=UPLUS
$this: CONST Int type=kotlin.Int value='42'
CONST Int type=kotlin.Int value='42'
FUN public fun test5(/*0*/ x: kotlin.Boolean): kotlin.Boolean
BLOCK_BODY
RETURN type=kotlin.Nothing from=test5
@@ -27,5 +25,4 @@ FILE /simpleUnaryOperators.kt
FUN public fun test6(): kotlin.Boolean
BLOCK_BODY
RETURN type=kotlin.Nothing from=test6
CALL .not type=kotlin.Boolean operator=EXCL
$this: CONST Boolean type=kotlin.Boolean value='true'
CONST Boolean type=kotlin.Boolean value='false'