JVM IR: prevent behavior change with operator dot calls on literals

#KT-42321 Fixed
This commit is contained in:
Alexander Udalov
2021-02-25 20:20:03 +01:00
parent c7498dd74d
commit bf844aa8e4
22 changed files with 920 additions and 50 deletions
@@ -0,0 +1,224 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// This test exists only to check that we don't accidentally break the buggy behavior of the old JVM backend in JVM IR (KT-42321).
// Feel free to remove it as soon as there's no language version where such code is allowed (KT-38895).
// FILE: test.kt
import kotlin.reflect.KClass
class K<L>(val type: KClass<out Number>) {
fun check(o: L, description: String, expected: KClass<out Number> = Int::class) {
val x = o as Any
if (x::class != expected) {
throw AssertionError("Fail K<${type.simpleName}> $description: " +
"expected ${expected.qualifiedName}, actual ${x::class.qualifiedName}")
}
}
}
fun box(): String {
val kl = K<Long>(Long::class)
kl.check(1.plus(2), "plus", Int::class)
kl.check(1.minus(2), "minus", Int::class)
kl.check(1.times(2), "times", Int::class)
kl.check(1.div(2), "div", Int::class)
kl.check(1.rem(2), "rem", Int::class)
kl.check(1.unaryPlus(), "unaryPlus", Int::class)
kl.check(1.unaryMinus(), "unaryMinus", Int::class)
kl.check(1.shl(2), "shl", Int::class)
kl.check(1.shr(2), "shr", Int::class)
kl.check(1.ushr(2), "ushr", Int::class)
kl.check(1.and(2), "and", Int::class)
kl.check(1.or(2), "or", Int::class)
kl.check(1.xor(2), "xor", Int::class)
kl.check(1.inv(), "inv", Int::class)
kl.check(1 + 2, "plus via operator", Long::class)
kl.check(1 - 2, "minus via operator", Long::class)
kl.check(1 * 2, "times via operator", Long::class)
kl.check(1 / 2, "div via operator", Long::class)
kl.check(1 % 2, "rem via operator", Long::class)
kl.check(+1, "unaryPlus via operator", Long::class)
kl.check(-1, "unaryMinus via operator", Long::class)
kl.check(1 shl 2, "shl infix", Long::class)
kl.check(1 shr 2, "shr infix", Long::class)
kl.check(1 ushr 2, "ushr infix", Long::class)
kl.check(1 and 2, "and infix", Long::class)
kl.check(1 or 2, "or infix", Long::class)
kl.check(1 xor 2, "xor infix", Long::class)
val ks = K<Short>(Short::class)
ks.check(1.plus(2), "plus", Int::class)
ks.check(1.minus(2), "minus", Int::class)
ks.check(1.times(2), "times", Int::class)
ks.check(1.div(2), "div", Int::class)
ks.check(1.rem(2), "rem", Int::class)
ks.check(1.unaryPlus(), "unaryPlus", Int::class)
ks.check(1.unaryMinus(), "unaryMinus", Int::class)
ks.check(1.shl(2), "shl", Int::class)
ks.check(1.shr(2), "shr", Int::class)
ks.check(1.ushr(2), "ushr", Int::class)
ks.check(1.and(2), "and", Int::class)
ks.check(1.or(2), "or", Int::class)
ks.check(1.xor(2), "xor", Int::class)
ks.check(1.inv(), "inv", Int::class)
ks.check(1 + 2, "plus via operator", Short::class)
ks.check(1 - 2, "minus via operator", Short::class)
ks.check(1 * 2, "times via operator", Short::class)
ks.check(1 / 2, "div via operator", Short::class)
ks.check(1 % 2, "rem via operator", Short::class)
ks.check(+1, "unaryPlus via operator", Short::class)
ks.check(-1, "unaryMinus via operator", Short::class)
ks.check(1 shl 2, "shl infix", Short::class)
ks.check(1 shr 2, "shr infix", Short::class)
ks.check(1 ushr 2, "ushr infix", Short::class)
ks.check(1 and 2, "and infix", Short::class)
ks.check(1 or 2, "or infix", Short::class)
ks.check(1 xor 2, "xor infix", Short::class)
val kb = K<Byte>(Byte::class)
kb.check(1.plus(2), "plus", Int::class)
kb.check(1.minus(2), "minus", Int::class)
kb.check(1.times(2), "times", Int::class)
kb.check(1.div(2), "div", Int::class)
kb.check(1.rem(2), "rem", Int::class)
kb.check(1.unaryPlus(), "unaryPlus", Int::class)
kb.check(1.unaryMinus(), "unaryMinus", Int::class)
kb.check(1.shl(2), "shl", Int::class)
kb.check(1.shr(2), "shr", Int::class)
kb.check(1.ushr(2), "ushr", Int::class)
kb.check(1.and(2), "and", Int::class)
kb.check(1.or(2), "or", Int::class)
kb.check(1.xor(2), "xor", Int::class)
kb.check(1.inv(), "inv", Int::class)
kb.check(1 + 2, "plus via operator", Byte::class)
kb.check(1 - 2, "minus via operator", Byte::class)
kb.check(1 * 2, "times via operator", Byte::class)
kb.check(1 / 2, "div via operator", Byte::class)
kb.check(1 % 2, "rem via operator", Byte::class)
kb.check(+1, "unaryPlus via operator", Byte::class)
kb.check(-1, "unaryMinus via operator", Byte::class)
kb.check(1 shl 2, "shl infix", Byte::class)
kb.check(1 shr 2, "shr infix", Byte::class)
kb.check(1 ushr 2, "ushr infix", Byte::class)
kb.check(1 and 2, "and infix", Byte::class)
kb.check(1 or 2, "or infix", Byte::class)
kb.check(1 xor 2, "xor infix", Byte::class)
val jl = J<Long>(Long::class)
jl.check(1.plus(2), "plus", Int::class)
jl.check(1.minus(2), "minus", Int::class)
jl.check(1.times(2), "times", Int::class)
jl.check(1.div(2), "div", Int::class)
jl.check(1.rem(2), "rem", Int::class)
jl.check(1.unaryPlus(), "unaryPlus", Int::class)
jl.check(1.unaryMinus(), "unaryMinus", Int::class)
jl.check(1.shl(2), "shl", Int::class)
jl.check(1.shr(2), "shr", Int::class)
jl.check(1.ushr(2), "ushr", Int::class)
jl.check(1.and(2), "and", Int::class)
jl.check(1.or(2), "or", Int::class)
jl.check(1.xor(2), "xor", Int::class)
jl.check(1.inv(), "inv", Int::class)
jl.check(1 + 2, "plus via operator", Long::class)
jl.check(1 - 2, "minus via operator", Long::class)
jl.check(1 * 2, "times via operator", Long::class)
jl.check(1 / 2, "div via operator", Long::class)
jl.check(1 % 2, "rem via operator", Long::class)
jl.check(+1, "unaryPlus via operator", Long::class)
jl.check(-1, "unaryMinus via operator", Long::class)
jl.check(1 shl 2, "shl infix", Long::class)
jl.check(1 shr 2, "shr infix", Long::class)
jl.check(1 ushr 2, "ushr infix", Long::class)
jl.check(1 and 2, "and infix", Long::class)
jl.check(1 or 2, "or infix", Long::class)
jl.check(1 xor 2, "xor infix", Long::class)
val js = J<Short>(Short::class)
js.check(1.plus(2), "plus", Int::class)
js.check(1.minus(2), "minus", Int::class)
js.check(1.times(2), "times", Int::class)
js.check(1.div(2), "div", Int::class)
js.check(1.rem(2), "rem", Int::class)
js.check(1.unaryPlus(), "unaryPlus", Int::class)
js.check(1.unaryMinus(), "unaryMinus", Int::class)
js.check(1.shl(2), "shl", Int::class)
js.check(1.shr(2), "shr", Int::class)
js.check(1.ushr(2), "ushr", Int::class)
js.check(1.and(2), "and", Int::class)
js.check(1.or(2), "or", Int::class)
js.check(1.xor(2), "xor", Int::class)
js.check(1.inv(), "inv", Int::class)
js.check(1 + 2, "plus via operator", Short::class)
js.check(1 - 2, "minus via operator", Short::class)
js.check(1 * 2, "times via operator", Short::class)
js.check(1 / 2, "div via operator", Short::class)
js.check(1 % 2, "rem via operator", Short::class)
js.check(+1, "unaryPlus via operator", Short::class)
js.check(-1, "unaryMinus via operator", Short::class)
js.check(1 shl 2, "shl infix", Short::class)
js.check(1 shr 2, "shr infix", Short::class)
js.check(1 ushr 2, "ushr infix", Short::class)
js.check(1 and 2, "and infix", Short::class)
js.check(1 or 2, "or infix", Short::class)
js.check(1 xor 2, "xor infix", Short::class)
val jb = J<Byte>(Byte::class)
jb.check(1.plus(2), "plus", Int::class)
jb.check(1.minus(2), "minus", Int::class)
jb.check(1.times(2), "times", Int::class)
jb.check(1.div(2), "div", Int::class)
jb.check(1.rem(2), "rem", Int::class)
jb.check(1.unaryPlus(), "unaryPlus", Int::class)
jb.check(1.unaryMinus(), "unaryMinus", Int::class)
jb.check(1.shl(2), "shl", Int::class)
jb.check(1.shr(2), "shr", Int::class)
jb.check(1.ushr(2), "ushr", Int::class)
jb.check(1.and(2), "and", Int::class)
jb.check(1.or(2), "or", Int::class)
jb.check(1.xor(2), "xor", Int::class)
jb.check(1.inv(), "inv", Int::class)
jb.check(1 + 2, "plus via operator", Byte::class)
jb.check(1 - 2, "minus via operator", Byte::class)
jb.check(1 * 2, "times via operator", Byte::class)
jb.check(1 / 2, "div via operator", Byte::class)
jb.check(1 % 2, "rem via operator", Byte::class)
jb.check(+1, "unaryPlus via operator", Byte::class)
jb.check(-1, "unaryMinus via operator", Byte::class)
jb.check(1 shl 2, "shl infix", Byte::class)
jb.check(1 shr 2, "shr infix", Byte::class)
jb.check(1 ushr 2, "ushr infix", Byte::class)
jb.check(1 and 2, "and infix", Byte::class)
jb.check(1 or 2, "or infix", Byte::class)
jb.check(1 xor 2, "xor infix", Byte::class)
return "OK"
}
// FILE: J.java
import kotlin.jvm.JvmClassMappingKt;
import kotlin.reflect.KClass;
public class J<M> {
private final KClass<? extends Number> type;
public J(KClass<? extends Number> type) {
this.type = type;
}
public void check(M x, String description, KClass<? extends Number> expected) {
KClass<?> actual = JvmClassMappingKt.getKotlinClass(x.getClass());
if (!actual.equals(expected)) {
throw new AssertionError("Fail J<" + type.getSimpleName() + "> " + description + ": " +
"expected: " + expected.getQualifiedName() + ", actual: " + actual.getQualifiedName());
}
}
}
@@ -0,0 +1,67 @@
// This test exists only to check that we don't accidentally break the buggy behavior of the old JVM backend in JVM IR (KT-42321).
// Feel free to remove it as soon as there's no language version where such code is allowed (KT-38895).
abstract class C<L> {
abstract fun takeT(x: L)
}
fun testLongDotCall(c1: C<Long>) {
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.plus(2))
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.minus(2))
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.times(2))
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.div(2))
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.rem(2))
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.inc())
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.dec())
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.unaryPlus())
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.unaryMinus())
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.shl(2))
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.shr(2))
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.ushr(2))
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.and(2))
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.or(2))
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.xor(2))
c1.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.inv())
}
fun testShortDotCall(c2: C<Short>) {
c2.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.plus(2))
c2.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.inc())
c2.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.dec())
c2.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.shr(2))
c2.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.inv())
}
fun testByteDotCall(c3: C<Byte>) {
c3.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.plus(2))
c3.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.inc())
c3.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.dec())
c3.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.shr(2))
c3.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1.inv())
}
fun testLongOperatorInfixCall(c4: C<Long>) {
c4.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 + 2)
c4.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 - 2)
c4.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 * 2)
c4.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 / 2)
c4.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 % 2)
c4.takeT(+1)
c4.takeT(-1)
c4.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 shl 2)
c4.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 shr 2)
c4.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 ushr 2)
c4.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 and 2)
c4.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 or 2)
c4.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 xor 2)
}
fun testShortOperatorInfixCall(c5: C<Short>) {
c5.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 + 2)
c5.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 shr 2)
}
fun testByteOperatorInfixCall(c6: C<Byte>) {
c6.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 + 2)
c6.<!INAPPLICABLE_CANDIDATE!>takeT<!>(1 shr 2)
}
@@ -0,0 +1,67 @@
// This test exists only to check that we don't accidentally break the buggy behavior of the old JVM backend in JVM IR (KT-42321).
// Feel free to remove it as soon as there's no language version where such code is allowed (KT-38895).
abstract class C<L> {
abstract fun takeT(x: L)
}
fun testLongDotCall(c1: C<Long>) {
c1.takeT(1.plus(2))
c1.takeT(1.minus(2))
c1.takeT(1.times(2))
c1.takeT(1.div(2))
c1.takeT(1.rem(2))
c1.takeT(<!TYPE_MISMATCH!>1.inc()<!>)
c1.takeT(<!TYPE_MISMATCH!>1.dec()<!>)
c1.takeT(1.unaryPlus())
c1.takeT(1.unaryMinus())
c1.takeT(1.shl(2))
c1.takeT(1.shr(2))
c1.takeT(1.ushr(2))
c1.takeT(1.and(2))
c1.takeT(1.or(2))
c1.takeT(1.xor(2))
c1.takeT(1.inv())
}
fun testShortDotCall(c2: C<Short>) {
c2.takeT(1.plus(2))
c2.takeT(<!TYPE_MISMATCH!>1.inc()<!>)
c2.takeT(<!TYPE_MISMATCH!>1.dec()<!>)
c2.takeT(1.shr(2))
c2.takeT(1.inv())
}
fun testByteDotCall(c3: C<Byte>) {
c3.takeT(1.plus(2))
c3.takeT(<!TYPE_MISMATCH!>1.inc()<!>)
c3.takeT(<!TYPE_MISMATCH!>1.dec()<!>)
c3.takeT(1.shr(2))
c3.takeT(1.inv())
}
fun testLongOperatorInfixCall(c4: C<Long>) {
c4.takeT(1 + 2)
c4.takeT(1 - 2)
c4.takeT(1 * 2)
c4.takeT(1 / 2)
c4.takeT(1 % 2)
c4.takeT(+1)
c4.takeT(-1)
c4.takeT(1 shl 2)
c4.takeT(1 shr 2)
c4.takeT(1 ushr 2)
c4.takeT(1 and 2)
c4.takeT(1 or 2)
c4.takeT(1 xor 2)
}
fun testShortOperatorInfixCall(c5: C<Short>) {
c5.takeT(1 + 2)
c5.takeT(1 shr 2)
}
fun testByteOperatorInfixCall(c6: C<Byte>) {
c6.takeT(1 + 2)
c6.takeT(1 shr 2)
}
@@ -0,0 +1,16 @@
package
public fun testByteDotCall(/*0*/ c3: C<kotlin.Byte>): kotlin.Unit
public fun testByteOperatorInfixCall(/*0*/ c6: C<kotlin.Byte>): kotlin.Unit
public fun testLongDotCall(/*0*/ c1: C<kotlin.Long>): kotlin.Unit
public fun testLongOperatorInfixCall(/*0*/ c4: C<kotlin.Long>): kotlin.Unit
public fun testShortDotCall(/*0*/ c2: C<kotlin.Short>): kotlin.Unit
public fun testShortOperatorInfixCall(/*0*/ c5: C<kotlin.Short>): kotlin.Unit
public abstract class C</*0*/ L> {
public constructor C</*0*/ L>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public abstract fun takeT(/*0*/ x: L): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
+118
View File
@@ -0,0 +1,118 @@
FILE fqName:<root> fileName:/kt42321.kt
CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C<L of <root>.C>
TYPE_PARAMETER name:L index:0 variance: superTypes:[kotlin.Any?]
CONSTRUCTOR visibility:public <> () returnType:<root>.C<L of <root>.C> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[kotlin.Any]'
FUN name:takeT visibility:public modality:ABSTRACT <> ($this:<root>.C<L of <root>.C>, x:L of <root>.C) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.C<L of <root>.C>
VALUE_PARAMETER name:x index:0 type:L of <root>.C
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:testLongDotCall visibility:public modality:FINAL <> (c1:<root>.C<kotlin.Long>) returnType:kotlin.Unit
VALUE_PARAMETER name:c1 index:0 type:<root>.C<kotlin.Long>
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=3
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=-1
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=2
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=0
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=1
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=1
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=-1
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=4
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=0
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=0
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=0
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=3
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=3
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=-2
FUN name:testShortDotCall visibility:public modality:FINAL <> (c2:<root>.C<kotlin.Short>) returnType:kotlin.Unit
VALUE_PARAMETER name:c2 index:0 type:<root>.C<kotlin.Short>
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=3
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=0
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=-2
FUN name:testByteDotCall visibility:public modality:FINAL <> (c3:<root>.C<kotlin.Byte>) returnType:kotlin.Unit
VALUE_PARAMETER name:c3 index:0 type:<root>.C<kotlin.Byte>
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=3
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=0
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=-2
FUN name:testLongOperatorInfixCall visibility:public modality:FINAL <> (c4:<root>.C<kotlin.Long>) returnType:kotlin.Unit
VALUE_PARAMETER name:c4 index:0 type:<root>.C<kotlin.Long>
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=3
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=-1
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=2
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=0
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=1
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CONST Long type=kotlin.Long value=1
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CONST Long type=kotlin.Long value=-1
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=4
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=0
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=0
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=0
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=3
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=3
FUN name:testShortOperatorInfixCall visibility:public modality:FINAL <> (c5:<root>.C<kotlin.Short>) returnType:kotlin.Unit
VALUE_PARAMETER name:c5 index:0 type:<root>.C<kotlin.Short>
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=3
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=0
FUN name:testByteOperatorInfixCall visibility:public modality:FINAL <> (c6:<root>.C<kotlin.Byte>) returnType:kotlin.Unit
VALUE_PARAMETER name:c6 index:0 type:<root>.C<kotlin.Byte>
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=3
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /C.takeT>#' type=kotlin.Unit
CONST Int type=kotlin.Int value=0
+62
View File
@@ -0,0 +1,62 @@
// SKIP_KT_DUMP
// This test exists only to check that we don't accidentally break the buggy behavior of the old JVM backend in JVM IR (KT-42321).
// Feel free to remove it as soon as there's no language version where such code is allowed (KT-38895).
abstract class C<L> {
abstract fun takeT(x: L)
}
fun testLongDotCall(c1: C<Long>) {
c1.takeT(1.plus(2))
c1.takeT(1.minus(2))
c1.takeT(1.times(2))
c1.takeT(1.div(2))
c1.takeT(1.rem(2))
c1.takeT(1.unaryPlus())
c1.takeT(1.unaryMinus())
c1.takeT(1.shl(2))
c1.takeT(1.shr(2))
c1.takeT(1.ushr(2))
c1.takeT(1.and(2))
c1.takeT(1.or(2))
c1.takeT(1.xor(2))
c1.takeT(1.inv())
}
fun testShortDotCall(c2: C<Short>) {
c2.takeT(1.plus(2))
c2.takeT(1.shr(2))
c2.takeT(1.inv())
}
fun testByteDotCall(c3: C<Byte>) {
c3.takeT(1.plus(2))
c3.takeT(1.shr(2))
c3.takeT(1.inv())
}
fun testLongOperatorInfixCall(c4: C<Long>) {
c4.takeT(1 + 2)
c4.takeT(1 - 2)
c4.takeT(1 * 2)
c4.takeT(1 / 2)
c4.takeT(1 % 2)
c4.takeT(+1)
c4.takeT(-1)
c4.takeT(1 shl 2)
c4.takeT(1 shr 2)
c4.takeT(1 ushr 2)
c4.takeT(1 and 2)
c4.takeT(1 or 2)
c4.takeT(1 xor 2)
}
fun testShortOperatorInfixCall(c5: C<Short>) {
c5.takeT(1 + 2)
c5.takeT(1 shr 2)
}
fun testByteOperatorInfixCall(c6: C<Byte>) {
c6.takeT(1 + 2)
c6.takeT(1 shr 2)
}
+233
View File
@@ -0,0 +1,233 @@
FILE fqName:<root> fileName:/kt42321.kt
CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C<L of <root>.C>
TYPE_PARAMETER name:L index:0 variance: superTypes:[kotlin.Any?]
CONSTRUCTOR visibility:public <> () returnType:<root>.C<L of <root>.C> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[kotlin.Any]'
FUN name:takeT visibility:public modality:ABSTRACT <> ($this:<root>.C<L of <root>.C>, x:L of <root>.C) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.C<L of <root>.C>
VALUE_PARAMETER name:x index:0 type:L of <root>.C
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:testLongDotCall visibility:public modality:FINAL <> (c1:<root>.C<kotlin.Long>) returnType:kotlin.Unit
VALUE_PARAMETER name:c1 index:0 type:<root>.C<kotlin.Long>
BLOCK_BODY
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun div (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun rem (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun unaryPlus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun shl (bitCount: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
bitCount: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
bitCount: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun ushr (bitCount: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
bitCount: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun xor (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c1: <root>.C<kotlin.Long> declared in <root>.testLongDotCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public final fun inv (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
FUN name:testShortDotCall visibility:public modality:FINAL <> (c2:<root>.C<kotlin.Short>) returnType:kotlin.Unit
VALUE_PARAMETER name:c2 index:0 type:<root>.C<kotlin.Short>
BLOCK_BODY
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c2: <root>.C<kotlin.Short> declared in <root>.testShortDotCall' type=<root>.C<kotlin.Short> origin=null
x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c2: <root>.C<kotlin.Short> declared in <root>.testShortDotCall' type=<root>.C<kotlin.Short> origin=null
x: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
bitCount: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c2: <root>.C<kotlin.Short> declared in <root>.testShortDotCall' type=<root>.C<kotlin.Short> origin=null
x: CALL 'public final fun inv (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
FUN name:testByteDotCall visibility:public modality:FINAL <> (c3:<root>.C<kotlin.Byte>) returnType:kotlin.Unit
VALUE_PARAMETER name:c3 index:0 type:<root>.C<kotlin.Byte>
BLOCK_BODY
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c3: <root>.C<kotlin.Byte> declared in <root>.testByteDotCall' type=<root>.C<kotlin.Byte> origin=null
x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c3: <root>.C<kotlin.Byte> declared in <root>.testByteDotCall' type=<root>.C<kotlin.Byte> origin=null
x: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
bitCount: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c3: <root>.C<kotlin.Byte> declared in <root>.testByteDotCall' type=<root>.C<kotlin.Byte> origin=null
x: CALL 'public final fun inv (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
FUN name:testLongOperatorInfixCall visibility:public modality:FINAL <> (c4:<root>.C<kotlin.Long>) returnType:kotlin.Unit
VALUE_PARAMETER name:c4 index:0 type:<root>.C<kotlin.Long>
BLOCK_BODY
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MINUS
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MUL
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun div (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=DIV
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun rem (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PERC
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CONST Long type=kotlin.Long value=1
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CONST Long type=kotlin.Long value=-1
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun shl (bitCount: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
bitCount: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
bitCount: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun ushr (bitCount: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
bitCount: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c4: <root>.C<kotlin.Long> declared in <root>.testLongOperatorInfixCall' type=<root>.C<kotlin.Long> origin=null
x: CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun xor (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
FUN name:testShortOperatorInfixCall visibility:public modality:FINAL <> (c5:<root>.C<kotlin.Short>) returnType:kotlin.Unit
VALUE_PARAMETER name:c5 index:0 type:<root>.C<kotlin.Short>
BLOCK_BODY
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c5: <root>.C<kotlin.Short> declared in <root>.testShortOperatorInfixCall' type=<root>.C<kotlin.Short> origin=null
x: CALL 'public open fun toShort (): kotlin.Short declared in kotlin.Int' type=kotlin.Short origin=null
$this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c5: <root>.C<kotlin.Short> declared in <root>.testShortOperatorInfixCall' type=<root>.C<kotlin.Short> origin=null
x: CALL 'public open fun toShort (): kotlin.Short declared in kotlin.Int' type=kotlin.Short origin=null
$this: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
bitCount: CONST Int type=kotlin.Int value=2
FUN name:testByteOperatorInfixCall visibility:public modality:FINAL <> (c6:<root>.C<kotlin.Byte>) returnType:kotlin.Unit
VALUE_PARAMETER name:c6 index:0 type:<root>.C<kotlin.Byte>
BLOCK_BODY
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c6: <root>.C<kotlin.Byte> declared in <root>.testByteOperatorInfixCall' type=<root>.C<kotlin.Byte> origin=null
x: CALL 'public open fun toByte (): kotlin.Byte declared in kotlin.Int' type=kotlin.Byte origin=null
$this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CONST Int type=kotlin.Int value=1
other: CONST Int type=kotlin.Int value=2
CALL 'public abstract fun takeT (x: L of <root>.C): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR 'c6: <root>.C<kotlin.Byte> declared in <root>.testByteOperatorInfixCall' type=<root>.C<kotlin.Byte> origin=null
x: CALL 'public open fun toByte (): kotlin.Byte declared in kotlin.Int' type=kotlin.Byte origin=null
$this: CALL 'public final fun shr (bitCount: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
bitCount: CONST Int type=kotlin.Int value=2
@@ -11,15 +11,15 @@ val test3: Byte
get
val test4: Long
field = 42.unaryMinus().toLong()
field = 42.unaryMinus()
get
val test5: Short
field = 42.unaryMinus().toShort()
field = 42.unaryMinus()
get
val test6: Byte
field = 42.unaryMinus().toByte()
field = 42.unaryMinus()
get
fun test() {
@@ -27,16 +27,16 @@ fun test() {
val test2: Long = 42L
val test3: Long? = 42L
val test4: Long? = -1L
val test5: Long? = 1.unaryMinus().toLong()
val test6: Short? = 1.unaryMinus().toShort()
val test7: Byte? = 1.unaryMinus().toByte()
val test5: Long? = 1.unaryMinus()
val test6: Short? = 1.unaryMinus()
val test7: Byte? = 1.unaryMinus()
}
fun testImplicitArguments(x: Long = 1.unaryMinus().toLong()) {
fun testImplicitArguments(x: Long = 1.unaryMinus()) {
}
class TestImplicitArguments {
constructor(x: Long = 1.unaryMinus().toLong()) /* primary */ {
constructor(x: Long = 1.unaryMinus()) /* primary */ {
super/*Any*/()
/* <init>() */
@@ -29,9 +29,8 @@ FILE fqName:<root> fileName:/primitivesImplicitConversions.kt
PROPERTY name:test4 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Long visibility:private [final,static]
EXPRESSION_BODY
CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=42
CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=42
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test4> visibility:public modality:FINAL <> () returnType:kotlin.Long
correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val]
BLOCK_BODY
@@ -40,9 +39,8 @@ FILE fqName:<root> fileName:/primitivesImplicitConversions.kt
PROPERTY name:test5 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Short visibility:private [final,static]
EXPRESSION_BODY
CALL 'public open fun toShort (): kotlin.Short declared in kotlin.Int' type=kotlin.Short origin=null
$this: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=42
CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=42
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test5> visibility:public modality:FINAL <> () returnType:kotlin.Short
correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [val]
BLOCK_BODY
@@ -51,9 +49,8 @@ FILE fqName:<root> fileName:/primitivesImplicitConversions.kt
PROPERTY name:test6 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Byte visibility:private [final,static]
EXPRESSION_BODY
CALL 'public open fun toByte (): kotlin.Byte declared in kotlin.Int' type=kotlin.Byte origin=null
$this: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=42
CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=42
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test6> visibility:public modality:FINAL <> () returnType:kotlin.Byte
correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val]
BLOCK_BODY
@@ -70,32 +67,27 @@ FILE fqName:<root> fileName:/primitivesImplicitConversions.kt
VAR name:test4 type:kotlin.Long? [val]
CONST Long type=kotlin.Long value=-1
VAR name:test5 type:kotlin.Long? [val]
CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
VAR name:test6 type:kotlin.Short? [val]
CALL 'public open fun toShort (): kotlin.Short declared in kotlin.Int' type=kotlin.Short origin=null
$this: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
VAR name:test7 type:kotlin.Byte? [val]
CALL 'public open fun toByte (): kotlin.Byte declared in kotlin.Int' type=kotlin.Byte origin=null
$this: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
FUN name:testImplicitArguments visibility:public modality:FINAL <> (x:kotlin.Long) returnType:kotlin.Unit
VALUE_PARAMETER name:x index:0 type:kotlin.Long
EXPRESSION_BODY
CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
BLOCK_BODY
CLASS CLASS name:TestImplicitArguments modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestImplicitArguments
CONSTRUCTOR visibility:public <> (x:kotlin.Long) returnType:<root>.TestImplicitArguments [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Long
EXPRESSION_BODY
CALL 'public open fun toLong (): kotlin.Long declared in kotlin.Int' type=kotlin.Long origin=null
$this: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CONST Int type=kotlin.Int value=1
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestImplicitArguments modality:FINAL visibility:public superTypes:[kotlin.Any]'