Raw FIR: fix unary operators (now convention calls use receivers)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
77e83dd8cf
commit
73b1676a03
@@ -1216,14 +1216,15 @@ class RawFirBuilder(val session: FirSession, val stubMode: Boolean) {
|
||||
calleeReference = FirSimpleNamedReference(
|
||||
this@RawFirBuilder.session, expression.operationReference, conventionCallName
|
||||
)
|
||||
explicitReceiver = argument.toFirExpression("No operand")
|
||||
}
|
||||
} else {
|
||||
val firOperation = operationToken.toFirOperation()
|
||||
FirOperatorCallImpl(
|
||||
session, expression, firOperation
|
||||
)
|
||||
}.apply {
|
||||
arguments += argument.toFirExpression("No operand")
|
||||
).apply {
|
||||
arguments += argument.toFirExpression("No operand")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@ FILE: namedArgument.kt
|
||||
foo#()
|
||||
foo#(String(Alpha), Boolean(false), Double(2.71))
|
||||
foo#(first = String(Hello), second = Boolean(true))
|
||||
foo#(third = unaryMinus#(Double(1.0)), first = String(123))
|
||||
foo#(third = Double(1.0).unaryMinus#(), first = String(123))
|
||||
foo#(ERROR_EXPR(Argument is absent))
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ FILE: unary.kt
|
||||
}
|
||||
|
||||
when () {
|
||||
not#(==(x#, Int(0))) -> {
|
||||
==(x#, Int(0)).not#() -> {
|
||||
println#(String(000))
|
||||
}
|
||||
else -> {
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
7class U {
|
||||
operator fun contains(g: String): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun foo(u: U) {
|
||||
val b = false
|
||||
val i = 10
|
||||
val x = -i
|
||||
val y = !b
|
||||
val z = -1.0
|
||||
val w = +i
|
||||
|
||||
val g = "" !in u
|
||||
val f = "" !is Boolean
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
FILE: unaryOperators.kt
|
||||
public final class U : R|kotlin/Any| {
|
||||
public constructor(): R|U| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final operator fun contains(g: R|kotlin/String|): R|kotlin/Boolean| {
|
||||
^contains Boolean(false)
|
||||
}
|
||||
|
||||
}
|
||||
public final fun foo(u: R|U|): R|kotlin/Unit| {
|
||||
lval b: R|kotlin/Boolean| = Boolean(false)
|
||||
lval i: R|kotlin/Int| = Int(10)
|
||||
lval x: R|kotlin/Int| = R|<local>/i|.R|kotlin/Int.unaryMinus|()
|
||||
lval y: R|kotlin/Boolean| = R|<local>/b|.R|kotlin/Boolean.not|()
|
||||
lval z: R|kotlin/Double| = Double(1.0).R|kotlin/Double.unaryMinus|()
|
||||
lval w: R|kotlin/Int| = R|<local>/i|.R|kotlin/Int.unaryPlus|()
|
||||
lval g: R|kotlin/Boolean| = R|<local>/u|.R|/U.contains|(String()).R|kotlin/Boolean.not|()
|
||||
lval f: R|kotlin/Boolean| = (String() !is R|kotlin/Boolean|)
|
||||
}
|
||||
Generated
+5
@@ -43,4 +43,9 @@ public class FirResolveTestCaseWithStdlibGenerated extends AbstractFirResolveTes
|
||||
public void testReflectionClass() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/reflectionClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unaryOperators.kt")
|
||||
public void testUnaryOperators() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/unaryOperators.kt");
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+12
-17
@@ -22,8 +22,7 @@ FILE fqName:<root> fileName:/whenByFloatingPoint.kt
|
||||
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double
|
||||
GET_VAR 'x: kotlin.Any declared in <root>.testSmartCastInWhenSubject' type=kotlin.Any origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Int type=kotlin.Int value=1
|
||||
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in <root>'
|
||||
BLOCK type=kotlin.Int origin=WHEN
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp1_subject type:kotlin.Any [val]
|
||||
@@ -45,8 +44,7 @@ FILE fqName:<root> fileName:/whenByFloatingPoint.kt
|
||||
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double
|
||||
GET_VAR 'y: kotlin.Any declared in <root>.testSmartCastInWhenCondition' type=kotlin.Any origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenCondition (x: kotlin.Double, y: kotlin.Any): kotlin.Int declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Int type=kotlin.Int value=1
|
||||
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenCondition (x: kotlin.Double, y: kotlin.Any): kotlin.Int declared in <root>'
|
||||
BLOCK type=kotlin.Int origin=WHEN
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp2_subject type:kotlin.Double [val]
|
||||
@@ -59,26 +57,25 @@ FILE fqName:<root> fileName:/whenByFloatingPoint.kt
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST Int type=kotlin.Int value=1
|
||||
FUN name:testSmartCastInWhenConditionInBranch visibility:public modality:FINAL <> (x:kotlin.Any) returnType:IrErrorType
|
||||
FUN name:testSmartCastInWhenConditionInBranch visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Int
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Any
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenConditionInBranch (x: kotlin.Any): IrErrorType declared in <root>'
|
||||
BLOCK type=IrErrorType origin=WHEN
|
||||
RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenConditionInBranch (x: kotlin.Any): kotlin.Int declared in <root>'
|
||||
BLOCK type=kotlin.Int origin=WHEN
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp3_subject type:kotlin.Any [val]
|
||||
WHEN type=IrErrorType origin=WHEN
|
||||
WHEN type=kotlin.Int origin=WHEN
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double
|
||||
GET_VAR 'val tmp3_subject: kotlin.Any [val] declared in <root>.testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null
|
||||
then: ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Int type=kotlin.Int value=1
|
||||
then: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR 'val tmp3_subject: kotlin.Any [val] declared in <root>.testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null
|
||||
arg1: CONST Double type=IrErrorType value=0.0
|
||||
then: CONST Int type=IrErrorType value=0
|
||||
arg1: CONST Double type=kotlin.Int value=0.0
|
||||
then: CONST Int type=kotlin.Int value=0
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST Int type=IrErrorType value=1
|
||||
then: CONST Int type=kotlin.Int value=1
|
||||
FUN name:testSmartCastToDifferentTypes visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Int
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Any
|
||||
VALUE_PARAMETER name:y index:1 type:kotlin.Any
|
||||
@@ -88,15 +85,13 @@ FILE fqName:<root> fileName:/whenByFloatingPoint.kt
|
||||
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double
|
||||
GET_VAR 'x: kotlin.Any declared in <root>.testSmartCastToDifferentTypes' type=kotlin.Any origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Int type=kotlin.Int value=1
|
||||
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
WHEN type=kotlin.Int origin=IF
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Float
|
||||
GET_VAR 'y: kotlin.Any declared in <root>.testSmartCastToDifferentTypes' type=kotlin.Any origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Int type=kotlin.Int value=1
|
||||
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in <root>'
|
||||
BLOCK type=kotlin.Int origin=WHEN
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp4_subject type:kotlin.Any [val]
|
||||
|
||||
@@ -11,13 +11,12 @@ FILE fqName:<root> fileName:/ifElseIf.kt
|
||||
then: CONST Int type=kotlin.Int value=1
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: WHEN type=IrErrorType origin=IF
|
||||
then: WHEN type=kotlin.Int origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'i: kotlin.Int declared in <root>.test' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=0
|
||||
then: ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Int type=kotlin.Int value=1
|
||||
then: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST Int type=kotlin.Int value=0
|
||||
|
||||
+20
-24
@@ -9,15 +9,14 @@ FILE fqName:<root> fileName:/literals.kt
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): kotlin.Int declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null
|
||||
PROPERTY name:test2 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static]
|
||||
EXPRESSION_BODY
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Int type=kotlin.Int value=1
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test2> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test2> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): IrErrorType declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): kotlin.Int declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null
|
||||
PROPERTY name:test3 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Boolean visibility:public [final,static]
|
||||
EXPRESSION_BODY
|
||||
@@ -64,15 +63,14 @@ FILE fqName:<root> fileName:/literals.kt
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test7> (): kotlin.Long declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test7 type:kotlin.Long visibility:public [final,static] ' type=kotlin.Long origin=null
|
||||
PROPERTY name:test8 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test8 type:IrErrorType visibility:public [final,static]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Long visibility:public [final,static]
|
||||
EXPRESSION_BODY
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Long type=kotlin.Long value=1
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test8> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
CALL 'public final fun unaryMinus (): kotlin.Long declared in kotlin.Long' type=kotlin.Long origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test8> visibility:public modality:FINAL <> () returnType:kotlin.Long
|
||||
correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test8> (): IrErrorType declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test8> (): kotlin.Long declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Long visibility:public [final,static] ' type=kotlin.Long origin=null
|
||||
PROPERTY name:test9 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Double visibility:public [final,static]
|
||||
EXPRESSION_BODY
|
||||
@@ -83,15 +81,14 @@ FILE fqName:<root> fileName:/literals.kt
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test9> (): kotlin.Double declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Double visibility:public [final,static] ' type=kotlin.Double origin=null
|
||||
PROPERTY name:test10 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test10 type:IrErrorType visibility:public [final,static]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test10 type:kotlin.Double visibility:public [final,static]
|
||||
EXPRESSION_BODY
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Double type=kotlin.Double value=1.0
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test10> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
CALL 'public final fun unaryMinus (): kotlin.Double declared in kotlin.Double' type=kotlin.Double origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test10> visibility:public modality:FINAL <> () returnType:kotlin.Double
|
||||
correspondingProperty: PROPERTY name:test10 visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test10> (): IrErrorType declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test10 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test10> (): kotlin.Double declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test10 type:kotlin.Double visibility:public [final,static] ' type=kotlin.Double origin=null
|
||||
PROPERTY name:test11 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test11 type:kotlin.Float visibility:public [final,static]
|
||||
EXPRESSION_BODY
|
||||
@@ -102,15 +99,14 @@ FILE fqName:<root> fileName:/literals.kt
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test11> (): kotlin.Float declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test11 type:kotlin.Float visibility:public [final,static] ' type=kotlin.Float origin=null
|
||||
PROPERTY name:test12 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test12 type:IrErrorType visibility:public [final,static]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test12 type:kotlin.Float visibility:public [final,static]
|
||||
EXPRESSION_BODY
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Float type=kotlin.Float value=1.0
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test12> visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
CALL 'public final fun unaryMinus (): kotlin.Float declared in kotlin.Float' type=kotlin.Float origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test12> visibility:public modality:FINAL <> () returnType:kotlin.Float
|
||||
correspondingProperty: PROPERTY name:test12 visibility:public modality:FINAL [val]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test12> (): IrErrorType declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test12 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-test12> (): kotlin.Float declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test12 type:kotlin.Float visibility:public [final,static] ' type=kotlin.Float origin=null
|
||||
PROPERTY name:test13 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:test13 type:kotlin.Char visibility:public [final,static]
|
||||
EXPRESSION_BODY
|
||||
|
||||
+1
-2
@@ -62,8 +62,7 @@ FILE fqName:<root> fileName:/primitivesImplicitConversions.kt
|
||||
VAR name:test3 type:kotlin.Long? [val]
|
||||
CONST Int type=kotlin.Long? value=42
|
||||
VAR name:test4 type:kotlin.Long? [val]
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Int type=kotlin.Int value=1
|
||||
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
VAR name:test5 type:kotlin.Long? [val]
|
||||
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
VAR name:test6 type:kotlin.Short? [val]
|
||||
|
||||
@@ -1,34 +1,28 @@
|
||||
FILE fqName:<root> fileName:/simpleUnaryOperators.kt
|
||||
FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:IrErrorType
|
||||
FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Int
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.Int): IrErrorType declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
GET_VAR 'x: kotlin.Int declared in <root>.test1' type=kotlin.Int origin=null
|
||||
FUN name:test2 visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.Int): kotlin.Int declared in <root>'
|
||||
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test2 (): IrErrorType declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:IrErrorType
|
||||
RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in <root>'
|
||||
CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Int
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Int): IrErrorType declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryPlus>#' type=IrErrorType
|
||||
GET_VAR 'x: kotlin.Int declared in <root>.test3' type=kotlin.Int origin=null
|
||||
FUN name:test4 visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Int): kotlin.Int declared in <root>'
|
||||
CALL 'public final fun unaryPlus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
FUN name:test4 visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test4 (): IrErrorType declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: unaryPlus>#' type=IrErrorType
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN name:test5 visibility:public modality:FINAL <> (x:kotlin.Boolean) returnType:IrErrorType
|
||||
RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Int declared in <root>'
|
||||
CALL 'public final fun unaryPlus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
FUN name:test5 visibility:public modality:FINAL <> (x:kotlin.Boolean) returnType:kotlin.Boolean
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Boolean
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test5 (x: kotlin.Boolean): IrErrorType declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: not>#' type=IrErrorType
|
||||
GET_VAR 'x: kotlin.Boolean declared in <root>.test5' type=kotlin.Boolean origin=null
|
||||
FUN name:test6 visibility:public modality:FINAL <> () returnType:IrErrorType
|
||||
RETURN type=kotlin.Nothing from='public final fun test5 (x: kotlin.Boolean): kotlin.Boolean declared in <root>'
|
||||
CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null
|
||||
FUN name:test6 visibility:public modality:FINAL <> () returnType:kotlin.Boolean
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test6 (): IrErrorType declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: not>#' type=IrErrorType
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
RETURN type=kotlin.Nothing from='public final fun test6 (): kotlin.Boolean declared in <root>'
|
||||
CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null
|
||||
|
||||
@@ -33,5 +33,4 @@ FILE fqName:<root> fileName:/whenWithSubjectVariable.kt
|
||||
then: CONST Int type=kotlin.Int value=4
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: ERROR_CALL 'Unresolved reference: <Unresolved name: unaryMinus>#' type=IrErrorType
|
||||
CONST Int type=kotlin.Int value=1
|
||||
then: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
|
||||
@@ -6,8 +6,8 @@ FILE: jvm.kt
|
||||
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval res1: R|kotlin/Boolean| = R|/Some.foo|(Int(1))
|
||||
lval res2: R|kotlin/Boolean| = R|/Some.foo|(<Unresolved name: unaryMinus>#(Int(1)))
|
||||
lval res3: R|kotlin/Array<ft<java/lang/String, java/lang/String?>>| = R|/Some.bar|(R|kotlin/intArrayOf|(Int(0), Int(2), <Unresolved name: unaryMinus>#(Int(2))))
|
||||
lval res2: R|kotlin/Boolean| = R|/Some.foo|(Int(1).R|kotlin/Int.unaryMinus|())
|
||||
lval res3: R|kotlin/Array<ft<java/lang/String, java/lang/String?>>| = R|/Some.bar|(R|kotlin/intArrayOf|(Int(0), Int(2), Int(2).R|kotlin/Int.unaryMinus|()))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user