[IR] update testdata: better support for IrCall
This commit is contained in:
committed by
teamcityserver
parent
ef2adfa835
commit
197f5ca885
@@ -26,15 +26,15 @@ class Test1<E : Any?> : IBase<E> {
|
||||
|
||||
override val <C : Any?> C.id: Map<E, C>?
|
||||
override get(): Map<E, C>? {
|
||||
return #$$delegate_0.<get-id><C>($receiver = <this>)
|
||||
return (#$$delegate_0, <this>).<get-id><C>()
|
||||
}
|
||||
|
||||
override var <D : Any?> List<D>.x: D?
|
||||
override get(): D? {
|
||||
return #$$delegate_0.<get-x><D>($receiver = <this>)
|
||||
return (#$$delegate_0, <this>).<get-x><D>()
|
||||
}
|
||||
override set(<set-?>: D?) {
|
||||
#$$delegate_0.<set-x><D>($receiver = <this>, <set-?> = <set-?>)
|
||||
(#$$delegate_0, <this>).<set-x><D>(<set-?> = <set-?>)
|
||||
}
|
||||
|
||||
|
||||
@@ -61,15 +61,15 @@ class Test2 : IBase<String> {
|
||||
|
||||
override val <C : Any?> C.id: Map<String, C>?
|
||||
override get(): Map<String, C>? {
|
||||
return #$$delegate_0.<get-id><C>($receiver = <this>)
|
||||
return (#$$delegate_0, <this>).<get-id><C>()
|
||||
}
|
||||
|
||||
override var <D : Any?> List<D>.x: D?
|
||||
override get(): D? {
|
||||
return #$$delegate_0.<get-x><D>($receiver = <this>)
|
||||
return (#$$delegate_0, <this>).<get-x><D>()
|
||||
}
|
||||
override set(<set-?>: D?) {
|
||||
#$$delegate_0.<set-x><D>($receiver = <this>, <set-?> = <set-?>)
|
||||
(#$$delegate_0, <this>).<set-x><D>(<set-?> = <set-?>)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class Test1 : IBase {
|
||||
}
|
||||
|
||||
override fun String.qux() {
|
||||
#$$delegate_0.qux($receiver = <this>)
|
||||
(#$$delegate_0, <this>).qux()
|
||||
}
|
||||
|
||||
|
||||
@@ -131,13 +131,13 @@ class Test2 : IBase, IOther {
|
||||
}
|
||||
|
||||
override fun String.qux() {
|
||||
#$$delegate_0.qux($receiver = <this>)
|
||||
(#$$delegate_0, <this>).qux()
|
||||
}
|
||||
|
||||
private /*final field*/ val $$delegate_1: IOther = otherImpl(x0 = "", y0 = 42)
|
||||
override val Byte.z1: Int
|
||||
override get(): Int {
|
||||
return #$$delegate_1.<get-z1>($receiver = <this>)
|
||||
return (#$$delegate_1, <this>).<get-z1>()
|
||||
}
|
||||
|
||||
override val x: String
|
||||
@@ -147,10 +147,10 @@ class Test2 : IBase, IOther {
|
||||
|
||||
override var Byte.z2: Int
|
||||
override get(): Int {
|
||||
return #$$delegate_1.<get-z2>($receiver = <this>)
|
||||
return (#$$delegate_1, <this>).<get-z2>()
|
||||
}
|
||||
override set(<set-?>: Int) {
|
||||
#$$delegate_1.<set-z2>($receiver = <this>, <set-?> = <set-?>)
|
||||
(#$$delegate_1, <this>).<set-z2>(<set-?> = <set-?>)
|
||||
}
|
||||
|
||||
override var y: Int
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ class K2 : JFoo {
|
||||
}
|
||||
|
||||
override fun foo(): String {
|
||||
return <this>.foo() /*!! String */
|
||||
return super.foo() /*!! String */
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class K4 : JUnrelatedFoo, IFoo {
|
||||
}
|
||||
|
||||
override fun foo(): @FlexibleNullability String? {
|
||||
return <this>.foo()
|
||||
return super.foo()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ class TestInitValInLambdaCalledOnce {
|
||||
get
|
||||
|
||||
init {
|
||||
run<Int, Unit>($receiver = 1, block = local fun Int.<anonymous>() {
|
||||
1.run<Int, Unit>(block = local fun Int.<anonymous>() {
|
||||
#x = 0
|
||||
}
|
||||
)
|
||||
|
||||
@@ -34,13 +34,13 @@ class CBoth : ILeft, IRight {
|
||||
}
|
||||
|
||||
override fun foo() {
|
||||
<this>.foo()
|
||||
<this>.foo()
|
||||
super.foo()
|
||||
super.foo()
|
||||
}
|
||||
|
||||
override val bar: Int
|
||||
override get(): Int {
|
||||
return <this>.<get-bar>().plus(other = <this>.<get-bar>())
|
||||
return super.<get-bar>().plus(other = super.<get-bar>())
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -13,7 +13,7 @@ open class Base {
|
||||
open get
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return <this>.hashCode()
|
||||
return super.hashCode()
|
||||
}
|
||||
|
||||
|
||||
@@ -28,12 +28,12 @@ class Derived : Base {
|
||||
}
|
||||
|
||||
override fun foo() {
|
||||
<this>.foo()
|
||||
super.foo()
|
||||
}
|
||||
|
||||
override val bar: String
|
||||
override get(): String {
|
||||
return <this>.<get-bar>()
|
||||
return super.<get-bar>()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,12 +35,12 @@ class Derived : Base, BaseI {
|
||||
}
|
||||
|
||||
override fun foo() {
|
||||
<this>.foo()
|
||||
super.foo()
|
||||
}
|
||||
|
||||
override val bar: String
|
||||
override get(): String {
|
||||
return <this>.<get-bar>()
|
||||
return super.<get-bar>()
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@ class DFoo : IFoo {
|
||||
private /*final field*/ val $$delegate_0: IFoo = d
|
||||
@Ann
|
||||
override fun String.testExtFun() {
|
||||
#$$delegate_0.testExtFun($receiver = <this>)
|
||||
(#$$delegate_0, <this>).testExtFun()
|
||||
}
|
||||
|
||||
@Ann
|
||||
@@ -43,7 +43,7 @@ class DFoo : IFoo {
|
||||
|
||||
override val String.testExtVal: String
|
||||
override get(): String {
|
||||
return #$$delegate_0.<get-testExtVal>($receiver = <this>)
|
||||
return (#$$delegate_0, <this>).<get-testExtVal>()
|
||||
}
|
||||
|
||||
override val testVal: String
|
||||
|
||||
+1
-1
@@ -11,6 +11,6 @@ val test1: Int /* by */
|
||||
}
|
||||
)
|
||||
get(): Int {
|
||||
return getValue<Int>($receiver = #test1$delegate, thisRef = null, property = ::test1)
|
||||
return #test1$delegate.getValue<Int>(thisRef = null, property = ::test1)
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -17,7 +17,7 @@ fun foo(m: Map<String, Int>) {
|
||||
}
|
||||
)
|
||||
local get(): Int {
|
||||
return getValue<Int>($receiver = test$delegate, thisRef = null, property = ::test)
|
||||
return test$delegate.getValue<Int>(thisRef = null, property = ::test)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -41,16 +41,16 @@ class C {
|
||||
}
|
||||
)
|
||||
get(): Int {
|
||||
return getValue<Int>($receiver = #test7$delegate, thisRef = <this>, property = ::test7)
|
||||
return #test7$delegate.getValue<Int>(thisRef = <this>, property = ::test7)
|
||||
}
|
||||
|
||||
var test8: Int /* by */
|
||||
field = hashMapOf<String, Int>()
|
||||
get(): Int {
|
||||
return getValue<Int, Int>($receiver = #test8$delegate, thisRef = <this>, property = ::test8)
|
||||
return #test8$delegate.getValue<Int, Int>(thisRef = <this>, property = ::test8)
|
||||
}
|
||||
set(<set-?>: Int) {
|
||||
return setValue<Int>($receiver = #test8$delegate, thisRef = <this>, property = ::test8, value = <set-?>)
|
||||
return #test8$delegate.setValue<Int>(thisRef = <this>, property = ::test8, value = <set-?>)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ val test1: Int /* by */
|
||||
}
|
||||
)
|
||||
get(): Int {
|
||||
return getValue<Int>($receiver = #test1$delegate, thisRef = null, property = ::test1)
|
||||
return #test1$delegate.getValue<Int>(thisRef = null, property = ::test1)
|
||||
}
|
||||
|
||||
class C {
|
||||
@@ -24,16 +24,16 @@ class C {
|
||||
}
|
||||
)
|
||||
get(): Int {
|
||||
return getValue<Int>($receiver = #test2$delegate, thisRef = <this>, property = ::test2)
|
||||
return #test2$delegate.getValue<Int>(thisRef = <this>, property = ::test2)
|
||||
}
|
||||
|
||||
var test3: Any /* by */
|
||||
field = <this>.<get-map>()
|
||||
get(): Any {
|
||||
return getValue<Any, Any>($receiver = #test3$delegate, thisRef = <this>, property = ::test3)
|
||||
return #test3$delegate.getValue<Any, Any>(thisRef = <this>, property = ::test3)
|
||||
}
|
||||
set(<set-?>: Any) {
|
||||
return setValue<Any>($receiver = #test3$delegate, thisRef = <this>, property = ::test3, value = <set-?>)
|
||||
return #test3$delegate.setValue<Any>(thisRef = <this>, property = ::test3, value = <set-?>)
|
||||
}
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@ class C {
|
||||
var test4: Any /* by */
|
||||
field = hashMapOf<String, Any>()
|
||||
get(): Any {
|
||||
return getValue<Any, Any>($receiver = #test4$delegate, thisRef = null, property = ::test4)
|
||||
return #test4$delegate.getValue<Any, Any>(thisRef = null, property = ::test4)
|
||||
}
|
||||
set(<set-?>: Any) {
|
||||
return setValue<Any>($receiver = #test4$delegate, thisRef = null, property = ::test4, value = <set-?>)
|
||||
return #test4$delegate.setValue<Any>(thisRef = null, property = ::test4, value = <set-?>)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ class A : I {
|
||||
private /*final field*/ val $$delegate_0: I = i
|
||||
override val <T : Any?> T.id: T
|
||||
override get(): T {
|
||||
return #$$delegate_0.<get-id><T>($receiver = <this>)
|
||||
return (#$$delegate_0, <this>).<get-id><T>()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ fun test1() {
|
||||
}
|
||||
)
|
||||
local get(): Int {
|
||||
return getValue<Int>($receiver = x$delegate, thisRef = null, property = ::x)
|
||||
return x$delegate.getValue<Int>(thisRef = null, property = ::x)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@ fun test2() {
|
||||
var x: Int
|
||||
val x$delegate: HashMap<String, Int> = hashMapOf<String, Int>()
|
||||
local get(): Int {
|
||||
return getValue<Int, Int>($receiver = x$delegate, thisRef = null, property = ::x)
|
||||
return x$delegate.getValue<Int, Int>(thisRef = null, property = ::x)
|
||||
}
|
||||
local set(value: Int) {
|
||||
return setValue<Int>($receiver = x$delegate, thisRef = null, property = ::x, value = value)
|
||||
return x$delegate.setValue<Int>(thisRef = null, property = ::x, value = value)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,15 +34,15 @@ val test7: Int /* by */
|
||||
}
|
||||
)
|
||||
get(): Int {
|
||||
return getValue<Int>($receiver = #test7$delegate, thisRef = null, property = ::test7)
|
||||
return #test7$delegate.getValue<Int>(thisRef = null, property = ::test7)
|
||||
}
|
||||
|
||||
var test8: Int /* by */
|
||||
field = hashMapOf<String, Int>()
|
||||
get(): Int {
|
||||
return getValue<Int, Int>($receiver = #test8$delegate, thisRef = null, property = ::test8)
|
||||
return #test8$delegate.getValue<Int, Int>(thisRef = null, property = ::test8)
|
||||
}
|
||||
set(<set-?>: Int) {
|
||||
return setValue<Int>($receiver = #test8$delegate, thisRef = null, property = ::test8, value = <set-?>)
|
||||
return #test8$delegate.setValue<Int>(thisRef = null, property = ::test8, value = <set-?>)
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -23,15 +23,15 @@ operator fun String.getValue(receiver: Any?, p: Any): String {
|
||||
}
|
||||
|
||||
val testO: String /* by */
|
||||
field = provideDelegate($receiver = TODO("IrConstructorCall"), host = null, p = ::testO)
|
||||
field = TODO("IrConstructorCall").provideDelegate(host = null, p = ::testO)
|
||||
get(): String {
|
||||
return getValue($receiver = #testO$delegate, receiver = null, p = ::testO)
|
||||
return #testO$delegate.getValue(receiver = null, p = ::testO)
|
||||
}
|
||||
|
||||
val testK: String /* by */
|
||||
field = "K"
|
||||
get(): String {
|
||||
return getValue($receiver = #testK$delegate, receiver = null, p = ::testK)
|
||||
return #testK$delegate.getValue(receiver = null, p = ::testK)
|
||||
}
|
||||
|
||||
val testOK: String
|
||||
|
||||
+3
-3
@@ -24,16 +24,16 @@ operator fun String.getValue(receiver: Any?, p: Any): String {
|
||||
|
||||
fun box(): String {
|
||||
val testO: String
|
||||
val testO$delegate: String = provideDelegate($receiver = TODO("IrConstructorCall"), host = null, p = ::testO)
|
||||
val testO$delegate: String = TODO("IrConstructorCall").provideDelegate(host = null, p = ::testO)
|
||||
local get(): String {
|
||||
return getValue($receiver = testO$delegate, receiver = null, p = ::testO)
|
||||
return testO$delegate.getValue(receiver = null, p = ::testO)
|
||||
}
|
||||
|
||||
|
||||
val testK: String
|
||||
val testK$delegate: String = "K"
|
||||
local get(): String {
|
||||
return getValue($receiver = testK$delegate, receiver = null, p = ::testK)
|
||||
return testK$delegate.getValue(receiver = null, p = ::testK)
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -30,13 +30,13 @@ object Host {
|
||||
}
|
||||
|
||||
val String.plusK: String /* by */
|
||||
field = <this>.provideDelegate($receiver = "K", host = <this>, p = ::plusK)
|
||||
field = (<this>, "K").provideDelegate(host = <this>, p = ::plusK)
|
||||
get(): String {
|
||||
return #plusK$delegate.getValue(receiver = <this>, p = ::plusK)
|
||||
}
|
||||
|
||||
val ok: String
|
||||
field = <this>.<get-plusK>($receiver = "O")
|
||||
field = (<this>, "O").<get-plusK>()
|
||||
get
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ fun foo(arg: Number) {
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val x: Int = 0
|
||||
foo(arg = convert<Number>($receiver = x))
|
||||
foo(arg = x.convert<Number>())
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ fun IB.test(a: IA) {
|
||||
{ // BLOCK
|
||||
val tmp0_array: IA = a
|
||||
val tmp1_index0: String = ""
|
||||
<this>.set($receiver = tmp0_array, index = tmp1_index0, value = tmp0_array.get(index = tmp1_index0).plus(other = 42))
|
||||
(<this>, tmp0_array).set(index = tmp1_index0, value = tmp0_array.get(index = tmp1_index0).plus(other = 42))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,28 +31,28 @@ val p: A
|
||||
|
||||
fun testVariable() {
|
||||
val a: A = TODO("IrConstructorCall")
|
||||
plusAssign($receiver = a, s = "+=")
|
||||
minusAssign($receiver = a, s = "-=")
|
||||
timesAssign($receiver = a, s = "*=")
|
||||
divAssign($receiver = a, s = "/=")
|
||||
remAssign($receiver = a, s = "*=")
|
||||
a.plusAssign(s = "+=")
|
||||
a.minusAssign(s = "-=")
|
||||
a.timesAssign(s = "*=")
|
||||
a.divAssign(s = "/=")
|
||||
a.remAssign(s = "*=")
|
||||
}
|
||||
|
||||
fun testProperty() {
|
||||
{ // BLOCK
|
||||
plusAssign($receiver = <get-p>(), s = "+=")
|
||||
<get-p>().plusAssign(s = "+=")
|
||||
}
|
||||
{ // BLOCK
|
||||
minusAssign($receiver = <get-p>(), s = "-=")
|
||||
<get-p>().minusAssign(s = "-=")
|
||||
}
|
||||
{ // BLOCK
|
||||
timesAssign($receiver = <get-p>(), s = "*=")
|
||||
<get-p>().timesAssign(s = "*=")
|
||||
}
|
||||
{ // BLOCK
|
||||
divAssign($receiver = <get-p>(), s = "/=")
|
||||
<get-p>().divAssign(s = "/=")
|
||||
}
|
||||
{ // BLOCK
|
||||
remAssign($receiver = <get-p>(), s = "%=")
|
||||
<get-p>().remAssign(s = "%=")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -24,21 +24,21 @@ fun C.extensionBoth(i: Int, s: String = "", vararg t: String) {
|
||||
|
||||
fun testExtensionVararg() {
|
||||
use(f = local fun extensionVararg(p0: C, p1: Int) {
|
||||
extensionVararg($receiver = p0, i = p1)
|
||||
p0.extensionVararg(i = p1)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun testExtensionDefault() {
|
||||
use(f = local fun extensionDefault(p0: C, p1: Int) {
|
||||
extensionDefault($receiver = p0, i = p1)
|
||||
p0.extensionDefault(i = p1)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun testExtensionBoth() {
|
||||
use(f = local fun extensionBoth(p0: C, p1: Int) {
|
||||
extensionBoth($receiver = p0, i = p1)
|
||||
p0.extensionBoth(i = p1)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -10,7 +10,7 @@ fun String.id(s: String = <this>, vararg xs: Int): String {
|
||||
fun test() {
|
||||
foo(x = { // BLOCK
|
||||
local fun String.id() {
|
||||
id($receiver = receiver, ) /*~> Unit */
|
||||
receiver.id() /*~> Unit */
|
||||
}
|
||||
|
||||
|
||||
|
||||
+6
-6
@@ -61,7 +61,7 @@ fun test1() {
|
||||
withVararg(xs = [p0]) /*~> Unit */
|
||||
}
|
||||
/*-> IFoo */
|
||||
set($receiver = tmp0_array, i = tmp2_sam, newValue = get($receiver = tmp0_array, i = tmp2_sam).plus(other = 1))
|
||||
tmp0_array.set(i = tmp2_sam, newValue = tmp0_array.get(i = tmp2_sam).plus(other = 1))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ fun test2() {
|
||||
withVararg(xs = [p0]) /*~> Unit */
|
||||
}
|
||||
/*-> IFoo2 */
|
||||
set($receiver = tmp0_array, i = tmp2_sam, newValue = get($receiver = tmp0_array, i = tmp2_sam).plus(other = 1))
|
||||
tmp0_array.set(i = tmp2_sam, newValue = tmp0_array.get(i = tmp2_sam).plus(other = 1))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ fun test3(fn: Function1<Int, Unit>) {
|
||||
{ // BLOCK
|
||||
val tmp0_array: A = A
|
||||
val tmp2_sam: IFoo = fn /*-> IFoo */
|
||||
set($receiver = tmp0_array, i = tmp2_sam, newValue = get($receiver = tmp0_array, i = tmp2_sam).plus(other = 1))
|
||||
tmp0_array.set(i = tmp2_sam, newValue = tmp0_array.get(i = tmp2_sam).plus(other = 1))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ fun test4(fn: Function1<Int, Unit>) {
|
||||
{ // BLOCK
|
||||
val tmp0_array: A = A
|
||||
val tmp1_index0: Function1<Int, Unit> = fn
|
||||
set($receiver = tmp0_array, i = tmp1_index0 /*as IFoo */, newValue = get($receiver = tmp0_array, i = tmp1_index0 /*as IFoo */).plus(other = 1))
|
||||
tmp0_array.set(i = tmp1_index0 /*as IFoo */, newValue = tmp0_array.get(i = tmp1_index0 /*as IFoo */).plus(other = 1))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ fun test5(a: Any) {
|
||||
{ // BLOCK
|
||||
val tmp0_array: A = A
|
||||
val tmp2_sam: IFoo = a /*as Function1<@ParameterName(...) Int, Unit> */ /*-> IFoo */
|
||||
set($receiver = tmp0_array, i = tmp2_sam, newValue = get($receiver = tmp0_array, i = tmp2_sam).plus(other = 1))
|
||||
tmp0_array.set(i = tmp2_sam, newValue = tmp0_array.get(i = tmp2_sam).plus(other = 1))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ fun test6(a: Any) {
|
||||
{ // BLOCK
|
||||
val tmp0_array: A = A
|
||||
val tmp1_index0: Any = a
|
||||
set($receiver = tmp0_array, i = tmp1_index0 /*as IFoo */, newValue = get($receiver = tmp0_array, i = tmp1_index0 /*as IFoo */).plus(other = 1))
|
||||
tmp0_array.set(i = tmp1_index0 /*as IFoo */, newValue = tmp0_array.get(i = tmp1_index0 /*as IFoo */).plus(other = 1))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -19,6 +19,6 @@ fun Int.ext2(x: Int): Int {
|
||||
}
|
||||
|
||||
fun Int.ext3(x: Int): Int {
|
||||
return foo(x = ext1($receiver = <this>), y = x)
|
||||
return foo(x = <this>.ext1(), y = x)
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class A {
|
||||
fun test() {
|
||||
A::class /*~> Unit */
|
||||
TODO("IrConstructorCall")::class /*~> Unit */
|
||||
<get-java><A>($receiver = A::class) /*~> Unit */
|
||||
<get-java><A>($receiver = TODO("IrConstructorCall")::class) /*~> Unit */
|
||||
A::class.<get-java><A>() /*~> Unit */
|
||||
TODO("IrConstructorCall")::class.<get-java><A>() /*~> Unit */
|
||||
}
|
||||
|
||||
|
||||
@@ -128,6 +128,6 @@ object Host {
|
||||
}
|
||||
|
||||
fun Host.test3(v: B) {
|
||||
<this>.plusAssign($receiver = v, b = TODO("IrConstructorCall"))
|
||||
(<this>, v).plusAssign(b = TODO("IrConstructorCall"))
|
||||
}
|
||||
|
||||
|
||||
@@ -12,18 +12,18 @@ interface IB {
|
||||
}
|
||||
|
||||
fun IB.test1(a1: IA, a2: IA): Boolean {
|
||||
return greater(arg0 = <this>.compareTo($receiver = a1, other = a2), arg1 = 0)
|
||||
return greater(arg0 = (<this>, a1).compareTo(other = a2), arg1 = 0)
|
||||
}
|
||||
|
||||
fun IB.test2(a1: IA, a2: IA): Boolean {
|
||||
return greaterOrEqual(arg0 = <this>.compareTo($receiver = a1, other = a2), arg1 = 0)
|
||||
return greaterOrEqual(arg0 = (<this>, a1).compareTo(other = a2), arg1 = 0)
|
||||
}
|
||||
|
||||
fun IB.test3(a1: IA, a2: IA): Boolean {
|
||||
return less(arg0 = <this>.compareTo($receiver = a1, other = a2), arg1 = 0)
|
||||
return less(arg0 = (<this>, a1).compareTo(other = a2), arg1 = 0)
|
||||
}
|
||||
|
||||
fun IB.test4(a1: IA, a2: IA): Boolean {
|
||||
return lessOrEqual(arg0 = <this>.compareTo($receiver = a1, other = a2), arg1 = 0)
|
||||
return lessOrEqual(arg0 = (<this>, a1).compareTo(other = a2), arg1 = 0)
|
||||
}
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ object B {
|
||||
fun B.test() {
|
||||
// COMPOSITE {
|
||||
val tmp0_container: A = A
|
||||
val x: Int = <this>.component1($receiver = tmp0_container)
|
||||
val y: Int = <this>.component2($receiver = tmp0_container)
|
||||
val x: Int = (<this>, tmp0_container).component1()
|
||||
val y: Int = (<this>, tmp0_container).component2()
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ object B {
|
||||
fun B.test() {
|
||||
// COMPOSITE {
|
||||
val tmp0_container: A = A
|
||||
val x: Int = <this>.component1($receiver = tmp0_container)
|
||||
val z: Int = <this>.component3($receiver = tmp0_container)
|
||||
val x: Int = (<this>, tmp0_container).component1()
|
||||
val z: Int = (<this>, tmp0_container).component3()
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@ val String.okext: String
|
||||
}
|
||||
|
||||
fun String.test5(): String {
|
||||
return <get-okext>($receiver = <this>)
|
||||
return <this>.<get-okext>()
|
||||
}
|
||||
|
||||
|
||||
@@ -54,9 +54,9 @@ interface IReceiver {
|
||||
|
||||
fun IReceiver.test() {
|
||||
{ // BLOCK
|
||||
val tmp0_iterator: IntCell = <this>.iterator($receiver = FiveTimes)
|
||||
while (<this>.hasNext($receiver = tmp0_iterator)) { // BLOCK
|
||||
val i: Int = <this>.next($receiver = tmp0_iterator)
|
||||
val tmp0_iterator: IntCell = (<this>, FiveTimes).iterator()
|
||||
while ((<this>, tmp0_iterator).hasNext()) { // BLOCK
|
||||
val i: Int = (<this>, tmp0_iterator).next()
|
||||
{ // BLOCK
|
||||
println(message = i)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ val <T : Any?> T.id: T
|
||||
}
|
||||
|
||||
val test: String
|
||||
field = <get-id><String>($receiver = "abc")
|
||||
field = "abc".<get-id><String>()
|
||||
get
|
||||
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@ private operator fun J.component2(): Int {
|
||||
fun test() {
|
||||
// COMPOSITE {
|
||||
val tmp0_container: @FlexibleNullability J? = j()
|
||||
val a: Int = component1($receiver = tmp0_container)
|
||||
val b: Int = component2($receiver = tmp0_container /*!! J */)
|
||||
val a: Int = tmp0_container.component1()
|
||||
val b: Int = tmp0_container /*!! J */.component2()
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@ operator fun Int.compareTo(c: Char): Int {
|
||||
}
|
||||
|
||||
fun testOverloadedCompareToCall(x: Int, y: Char): Boolean {
|
||||
return less(arg0 = compareTo($receiver = x, c = y), arg1 = 0)
|
||||
return less(arg0 = x.compareTo(c = y), arg1 = 0)
|
||||
}
|
||||
|
||||
fun testOverloadedCompareToCallWithSmartCast(x: Any, y: Any): Boolean {
|
||||
@@ -11,7 +11,7 @@ fun testOverloadedCompareToCallWithSmartCast(x: Any, y: Any): Boolean {
|
||||
when {
|
||||
x is Int -> y is Char
|
||||
true -> false
|
||||
} -> less(arg0 = compareTo($receiver = x /*as Int */, c = y /*as Char */), arg1 = 0)
|
||||
} -> less(arg0 = x /*as Int */.compareTo(c = y /*as Char */), arg1 = 0)
|
||||
true -> false
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ class C {
|
||||
}
|
||||
|
||||
fun testMemberExtensionCompareToCall(x: Int, y: Char): Boolean {
|
||||
return less(arg0 = <this>.compareTo($receiver = x, c = y), arg1 = 0)
|
||||
return less(arg0 = (<this>, x).compareTo(c = y), arg1 = 0)
|
||||
}
|
||||
|
||||
fun testMemberExtensionCompareToCallWithSmartCast(x: Any, y: Any): Boolean {
|
||||
@@ -46,7 +46,7 @@ class C {
|
||||
when {
|
||||
x is Int -> y is Char
|
||||
true -> false
|
||||
} -> less(arg0 = <this>.compareTo($receiver = x /*as Int */, c = y /*as Char */), arg1 = 0)
|
||||
} -> less(arg0 = (<this>, x /*as Int */).compareTo(c = y /*as Char */), arg1 = 0)
|
||||
true -> false
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -18,7 +18,7 @@ operator fun A.set(i: Int, j: Int, v: Int) {
|
||||
}
|
||||
|
||||
fun testSimpleAssignment(a: A) {
|
||||
set($receiver = a, i = 1, j = 2, v = 0)
|
||||
a.set(i = 1, j = 2, v = 0)
|
||||
}
|
||||
|
||||
fun testPostfixIncrement(a: A): Int {
|
||||
@@ -26,8 +26,8 @@ fun testPostfixIncrement(a: A): Int {
|
||||
val tmp0_array: A = a
|
||||
val tmp1_index0: Int = 1
|
||||
val tmp2_index1: Int = 2
|
||||
val tmp3: Int = get($receiver = tmp0_array, xs = [tmp1_index0, tmp2_index1])
|
||||
set($receiver = tmp0_array, i = tmp1_index0, j = tmp2_index1, v = tmp3.inc())
|
||||
val tmp3: Int = tmp0_array.get(xs = [tmp1_index0, tmp2_index1])
|
||||
tmp0_array.set(i = tmp1_index0, j = tmp2_index1, v = tmp3.inc())
|
||||
tmp3
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ fun testCompoundAssignment(a: A) {
|
||||
val tmp0_array: A = a
|
||||
val tmp1_index0: Int = 1
|
||||
val tmp2_index1: Int = 2
|
||||
set($receiver = tmp0_array, i = tmp1_index0, j = tmp2_index1, v = get($receiver = tmp0_array, xs = [tmp1_index0, tmp2_index1]).plus(other = 10))
|
||||
tmp0_array.set(i = tmp1_index0, j = tmp2_index1, v = tmp0_array.get(xs = [tmp1_index0, tmp2_index1]).plus(other = 10))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -14,6 +14,6 @@ operator fun A.set(vararg i: Int, v: Int) {
|
||||
}
|
||||
|
||||
fun testSimpleAssignment(a: A) {
|
||||
set($receiver = a, i = [1, 2, 3], v = 0)
|
||||
a.set(i = [1, 2, 3], v = 0)
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -18,15 +18,15 @@ operator fun A.set(i: Int, j: Int = 42, v: Int) {
|
||||
}
|
||||
|
||||
fun testSimpleAssignment(a: A) {
|
||||
set($receiver = a, i = 1, v = 0)
|
||||
a.set(i = 1, v = 0)
|
||||
}
|
||||
|
||||
fun testPostfixIncrement(a: A): Int {
|
||||
return { // BLOCK
|
||||
val tmp0_array: A = a
|
||||
val tmp1_index0: Int = 1
|
||||
val tmp2: Int = get($receiver = tmp0_array, i = tmp1_index0)
|
||||
set($receiver = tmp0_array, i = tmp1_index0, v = tmp2.inc())
|
||||
val tmp2: Int = tmp0_array.get(i = tmp1_index0)
|
||||
tmp0_array.set(i = tmp1_index0, v = tmp2.inc())
|
||||
tmp2
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ fun testCompoundAssignment(a: A) {
|
||||
{ // BLOCK
|
||||
val tmp0_array: A = a
|
||||
val tmp1_index0: Int = 1
|
||||
set($receiver = tmp0_array, i = tmp1_index0, v = get($receiver = tmp0_array, i = tmp1_index0).plus(other = 10))
|
||||
tmp0_array.set(i = tmp1_index0, v = tmp0_array.get(i = tmp1_index0).plus(other = 10))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -11,29 +11,29 @@ interface X {
|
||||
fun test(x: X, nx: X?) {
|
||||
{ // BLOCK
|
||||
val tmp0_this: X = x
|
||||
plusAssign<Int>($receiver = tmp0_this.<get-xs>(), element = 1)
|
||||
tmp0_this.<get-xs>().plusAssign<Int>(element = 1)
|
||||
}
|
||||
plusAssign<Int>($receiver = x.f(), element = 2)
|
||||
plusAssign<Int>($receiver = x.<get-xs>() as MutableList<Int>, element = 3)
|
||||
plusAssign<Int>($receiver = x.f() as MutableList<Int>, element = 4)
|
||||
plusAssign<Int>($receiver = CHECK_NOT_NULL<MutableList<Any>>(arg0 = { // BLOCK
|
||||
x.f().plusAssign<Int>(element = 2)
|
||||
x.<get-xs>() as MutableList<Int>.plusAssign<Int>(element = 3)
|
||||
x.f() as MutableList<Int>.plusAssign<Int>(element = 4)
|
||||
CHECK_NOT_NULL<MutableList<Any>>(arg0 = { // BLOCK
|
||||
val tmp1_safe_receiver: X? = nx
|
||||
when {
|
||||
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
|
||||
true -> tmp1_safe_receiver.<get-xs>()
|
||||
}
|
||||
}), element = 5)
|
||||
plusAssign<Int>($receiver = CHECK_NOT_NULL<MutableList<Any>>(arg0 = { // BLOCK
|
||||
}).plusAssign<Int>(element = 5)
|
||||
CHECK_NOT_NULL<MutableList<Any>>(arg0 = { // BLOCK
|
||||
val tmp2_safe_receiver: X? = nx
|
||||
when {
|
||||
EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null
|
||||
true -> tmp2_safe_receiver.f()
|
||||
}
|
||||
}), element = 6)
|
||||
}).plusAssign<Int>(element = 6)
|
||||
}
|
||||
|
||||
fun MutableList<Any>.testExtensionReceiver() {
|
||||
plusAssign<Int>($receiver = <this>, element = 100)
|
||||
<this>.plusAssign<Int>(element = 100)
|
||||
}
|
||||
|
||||
abstract class AML : MutableList<Int> {
|
||||
@@ -44,7 +44,7 @@ abstract class AML : MutableList<Int> {
|
||||
}
|
||||
|
||||
fun testExplicitThis() {
|
||||
plusAssign<Int>($receiver = <this>, element = 200)
|
||||
<this>.plusAssign<Int>(element = 200)
|
||||
}
|
||||
|
||||
inner class Inner {
|
||||
@@ -55,7 +55,7 @@ abstract class AML : MutableList<Int> {
|
||||
}
|
||||
|
||||
fun testOuterThis() {
|
||||
plusAssign<Int>($receiver = <this>, element = 300)
|
||||
<this>.plusAssign<Int>(element = 300)
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ class A {
|
||||
get
|
||||
|
||||
init {
|
||||
apply<String>($receiver = a(), block = local fun String.<anonymous>() {
|
||||
a().apply<String>(block = local fun String.<anonymous>() {
|
||||
#b = <this>
|
||||
}
|
||||
) /*~> Unit */
|
||||
|
||||
@@ -9,7 +9,7 @@ operator fun Any.set(index: Function0<Unit>, value: Int) {
|
||||
}
|
||||
|
||||
fun test1(a: Any) {
|
||||
plusAssign($receiver = a, lambda = local fun <anonymous>() {
|
||||
a.plusAssign(lambda = local fun <anonymous>() {
|
||||
return Unit
|
||||
}
|
||||
)
|
||||
@@ -22,7 +22,7 @@ fun test2(a: Any) {
|
||||
return Unit
|
||||
}
|
||||
|
||||
set($receiver = tmp0_array, index = tmp1_index0, value = get($receiver = tmp0_array, index = tmp1_index0).plus(other = 42))
|
||||
tmp0_array.set(index = tmp1_index0, value = tmp0_array.get(index = tmp1_index0).plus(other = 42))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ fun test3(a: Any) {
|
||||
return Unit
|
||||
}
|
||||
|
||||
val tmp2: Int = get($receiver = tmp0_array, index = tmp1_index0)
|
||||
set($receiver = tmp0_array, index = tmp1_index0, value = tmp2.inc())
|
||||
val tmp2: Int = tmp0_array.get(index = tmp1_index0)
|
||||
tmp0_array.set(index = tmp1_index0, value = tmp2.inc())
|
||||
tmp2
|
||||
} /*~> Unit */
|
||||
}
|
||||
|
||||
@@ -36,10 +36,10 @@ val test2: Int
|
||||
get
|
||||
|
||||
val test3: Int
|
||||
field = A.fooExt($receiver = 1)
|
||||
field = (A, 1).fooExt()
|
||||
get
|
||||
|
||||
val test4: Int
|
||||
field = A.<get-barExt>($receiver = 1)
|
||||
field = (A, 1).<get-barExt>()
|
||||
get
|
||||
|
||||
|
||||
@@ -39,10 +39,10 @@ operator fun En.invoke(i: Int): Int {
|
||||
}
|
||||
|
||||
val test1: Int
|
||||
field = invoke($receiver = A, i = 42)
|
||||
field = A.invoke(i = 42)
|
||||
get
|
||||
|
||||
val test2: Int
|
||||
field = invoke($receiver = En, i = 42)
|
||||
field = En.invoke(i = 42)
|
||||
get
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ object A {
|
||||
|
||||
fun test() {
|
||||
A::class /*~> Unit */
|
||||
<get-java><A>($receiver = A::class) /*~> Unit */
|
||||
A::class.<get-java><A>() /*~> Unit */
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,6 @@ val String.okext: String
|
||||
}
|
||||
|
||||
fun String.test5(): String {
|
||||
return <get-okext>($receiver = <this>)
|
||||
return <this>.<get-okext>()
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -44,8 +44,8 @@ fun testProperty(nc: C?) {
|
||||
true -> { // BLOCK
|
||||
val tmp1_receiver: C? = tmp0_safe_receiver
|
||||
{ // BLOCK
|
||||
val tmp2: Int = <get-p>($receiver = tmp1_receiver)
|
||||
<set-p>($receiver = tmp1_receiver, value = inc($receiver = tmp2))
|
||||
val tmp2: Int = tmp1_receiver.<get-p>()
|
||||
tmp1_receiver.<set-p>(value = tmp2.inc())
|
||||
tmp2
|
||||
}
|
||||
}
|
||||
@@ -59,12 +59,12 @@ fun testArrayAccess(nc: C?) {
|
||||
val tmp0_safe_receiver: C? = nc
|
||||
when {
|
||||
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
|
||||
true -> <get-p>($receiver = tmp0_safe_receiver)
|
||||
true -> tmp0_safe_receiver.<get-p>()
|
||||
}
|
||||
}
|
||||
val tmp2_index0: Int = 0
|
||||
val tmp3: Int = get($receiver = tmp1_array, index = tmp2_index0)
|
||||
set($receiver = tmp1_array, index = tmp2_index0, value = tmp3.inc())
|
||||
val tmp3: Int = tmp1_array.get(index = tmp2_index0)
|
||||
tmp1_array.set(index = tmp2_index0, value = tmp3.inc())
|
||||
tmp3
|
||||
} /*~> Unit */
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ fun IHost.test5(s: String?): Int? {
|
||||
val tmp0_safe_receiver: String? = s
|
||||
when {
|
||||
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
|
||||
true -> <this>.extLength($receiver = tmp0_safe_receiver)
|
||||
true -> (<this>, tmp0_safe_receiver).extLength()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ fun box() {
|
||||
val tmp0_safe_receiver: Int = 42
|
||||
when {
|
||||
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
|
||||
true -> foo($receiver = tmp0_safe_receiver)
|
||||
true -> tmp0_safe_receiver.foo()
|
||||
}
|
||||
} /*~> Unit */
|
||||
}
|
||||
|
||||
+7
-7
@@ -47,12 +47,12 @@ fun takeLong(l: Long) {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
takeUByte(u = toUByte($receiver = <get-IMPLICIT_INT>()))
|
||||
takeUByte(u = toUByte($receiver = <get-EXPLICIT_INT>()))
|
||||
takeUShort(u = toUShort($receiver = <get-IMPLICIT_INT>()))
|
||||
takeUShort(u = toUShort($receiver = <get-BIGGER_THAN_UBYTE>()))
|
||||
takeUInt(u = toUInt($receiver = <get-IMPLICIT_INT>()))
|
||||
takeULong(u = toULong($receiver = <get-IMPLICIT_INT>()))
|
||||
takeUBytes(u = [toUByte($receiver = <get-IMPLICIT_INT>()), toUByte($receiver = <get-EXPLICIT_INT>()), 42B])
|
||||
takeUByte(u = <get-IMPLICIT_INT>().toUByte())
|
||||
takeUByte(u = <get-EXPLICIT_INT>().toUByte())
|
||||
takeUShort(u = <get-IMPLICIT_INT>().toUShort())
|
||||
takeUShort(u = <get-BIGGER_THAN_UBYTE>().toUShort())
|
||||
takeUInt(u = <get-IMPLICIT_INT>().toUInt())
|
||||
takeULong(u = <get-IMPLICIT_INT>().toULong())
|
||||
takeUBytes(u = [<get-IMPLICIT_INT>().toUByte(), <get-EXPLICIT_INT>().toUByte(), 42B])
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ fun test(x: I1) {
|
||||
}
|
||||
// COMPOSITE {
|
||||
val tmp0_container: I1 = x
|
||||
val c1: Int = component1($receiver = tmp0_container)
|
||||
val c2: String = component2($receiver = tmp0_container /*as I2 */)
|
||||
val c1: Int = tmp0_container.component1()
|
||||
val c2: String = tmp0_container /*as I2 */.component2()
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
fun test1(x: Any): Boolean {
|
||||
return when {
|
||||
x is Array<*> -> isArrayOf<String>($receiver = x /*as Array<*> */)
|
||||
x is Array<*> -> x /*as Array<*> */.isArrayOf<String>()
|
||||
true -> false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,18 +23,18 @@ val testULongWithExpectedType: ULong
|
||||
get
|
||||
|
||||
val testToUByte: UByte
|
||||
field = toUByte($receiver = 1)
|
||||
field = 1.toUByte()
|
||||
get
|
||||
|
||||
val testToUShort: UShort
|
||||
field = toUShort($receiver = 1)
|
||||
field = 1.toUShort()
|
||||
get
|
||||
|
||||
val testToUInt: UInt
|
||||
field = toUInt($receiver = 1)
|
||||
field = 1.toUInt()
|
||||
get
|
||||
|
||||
val testToULong: ULong
|
||||
field = toULong($receiver = 1)
|
||||
field = 1.toULong()
|
||||
get
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ fun box(): String {
|
||||
EQEQ(arg0 = C.f(s = "s"), arg1 = 2).not() -> return "2"
|
||||
}
|
||||
when {
|
||||
EQEQ(arg0 = C.f($receiver = true), arg1 = 3).not() -> return "3"
|
||||
EQEQ(arg0 = (C, true).f(), arg1 = 3).not() -> return "3"
|
||||
}
|
||||
when {
|
||||
EQEQ(arg0 = C.<get-p>(), arg1 = 4).not() -> return "4"
|
||||
@@ -92,19 +92,19 @@ fun box(): String {
|
||||
EQEQ(arg0 = C.<get-p>(), arg1 = 5).not() -> return "5"
|
||||
}
|
||||
when {
|
||||
EQEQ(arg0 = C.<get-ext>($receiver = 5), arg1 = 6).not() -> return "6"
|
||||
EQEQ(arg0 = (C, 5).<get-ext>(), arg1 = 6).not() -> return "6"
|
||||
}
|
||||
when {
|
||||
EQEQ(arg0 = C.g1<String>(t = "7"), arg1 = "7").not() -> return "7"
|
||||
}
|
||||
when {
|
||||
EQEQ(arg0 = C.<get-g2><String>($receiver = "8"), arg1 = "8").not() -> return "8"
|
||||
EQEQ(arg0 = (C, "8").<get-g2><String>(), arg1 = "8").not() -> return "8"
|
||||
}
|
||||
when {
|
||||
EQEQ(arg0 = C.fromInterface<Int>($receiver = 9), arg1 = 9).not() -> return "9"
|
||||
EQEQ(arg0 = (C, 9).fromInterface<Int>(), arg1 = 9).not() -> return "9"
|
||||
}
|
||||
when {
|
||||
EQEQ(arg0 = C.<get-fromClass><String>($receiver = "10"), arg1 = "10").not() -> return "10"
|
||||
EQEQ(arg0 = (C, "10").<get-fromClass><String>(), arg1 = "10").not() -> return "10"
|
||||
}
|
||||
when {
|
||||
EQEQ(arg0 = C.genericFromSuper(g = "11"), arg1 = "11").not() -> return "11"
|
||||
|
||||
@@ -14,7 +14,7 @@ fun test2(f: @ExtensionFunctionType Function1<String, Unit>) {
|
||||
}
|
||||
|
||||
fun test3(): String {
|
||||
return k($receiver = "hello").invoke()
|
||||
return "hello".k().invoke()
|
||||
}
|
||||
|
||||
fun test4(ns: String?): String? {
|
||||
@@ -23,7 +23,7 @@ fun test4(ns: String?): String? {
|
||||
val tmp0_safe_receiver: String? = ns
|
||||
when {
|
||||
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
|
||||
true -> k($receiver = tmp0_safe_receiver)
|
||||
true -> tmp0_safe_receiver.k()
|
||||
}
|
||||
}
|
||||
when {
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ val <T : CharSequence> T.gk: Function0<T>
|
||||
}
|
||||
|
||||
fun testGeneric1(x: String): String {
|
||||
return <get-gk><String>($receiver = x).invoke()
|
||||
return x.<get-gk><String>().invoke()
|
||||
}
|
||||
|
||||
val <T : Any?> T.kt26531Val: Function0<T>
|
||||
@@ -19,6 +19,6 @@ val <T : Any?> T.kt26531Val: Function0<T>
|
||||
}
|
||||
|
||||
fun kt26531(): Int {
|
||||
return <get-kt26531Val><Int>($receiver = 7).invoke()
|
||||
return 7.<get-kt26531Val><Int>().invoke()
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ fun testWithSubject(x: Any?): String {
|
||||
EQEQ(arg0 = tmp0_subject, arg1 = A) -> "A"
|
||||
tmp0_subject is String -> "String"
|
||||
tmp0_subject is Number.not() -> "!Number"
|
||||
contains<Number>($receiver = setOf<Nothing>(), element = tmp0_subject /*as Number */) -> "nothingness?"
|
||||
setOf<Nothing>().contains<Number>(element = tmp0_subject /*as Number */) -> "nothingness?"
|
||||
true -> "something"
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ fun test(x: Any?): String {
|
||||
EQEQ(arg0 = x, arg1 = A) -> "A"
|
||||
x is String -> "String"
|
||||
x !is Number -> "!Number"
|
||||
contains<Number>($receiver = setOf<Nothing>(), element = x /*as Number */) -> "nothingness?"
|
||||
setOf<Nothing>().contains<Number>(element = x /*as Number */) -> "nothingness?"
|
||||
true -> "something"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ class MyCandidate {
|
||||
}
|
||||
|
||||
private fun <A : Any?> allCandidatesResult(allCandidates: Collection<MyCandidate>): @FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>? {
|
||||
return apply<@FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>?>($receiver = nameNotFound<@FlexibleNullability A?>(), block = local fun @FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>?.<anonymous>() {
|
||||
<this> /*!! OverloadResolutionResultsImpl<@FlexibleNullability A?> */.setAllCandidates<@FlexibleNullability A?>(allCandidates = map<MyCandidate, ResolvedCall<A>>($receiver = allCandidates, transform = local fun <anonymous>(it: MyCandidate): ResolvedCall<A> {
|
||||
return nameNotFound<@FlexibleNullability A?>().apply<@FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>?>(block = local fun @FlexibleNullability OverloadResolutionResultsImpl<@FlexibleNullability A?>?.<anonymous>() {
|
||||
<this> /*!! OverloadResolutionResultsImpl<@FlexibleNullability A?> */.setAllCandidates<@FlexibleNullability A?>(allCandidates = allCandidates.map<MyCandidate, ResolvedCall<A>>(transform = local fun <anonymous>(it: MyCandidate): ResolvedCall<A> {
|
||||
return it.<get-resolvedCall>() as ResolvedCall<A>
|
||||
}
|
||||
))
|
||||
|
||||
@@ -60,19 +60,19 @@ class DeepCopyIrTreeWithSymbols {
|
||||
}
|
||||
|
||||
fun IrTypeParametersContainer.copyTypeParametersFrom(other: IrTypeParametersContainer) {
|
||||
<this>.<set-typeParameters>(<set-?> = map<IrTypeParameter, IrTypeParameter>($receiver = other.<get-typeParameters>(), transform = local fun <anonymous>(it: IrTypeParameter): IrTypeParameter {
|
||||
<this>.<set-typeParameters>(<set-?> = other.<get-typeParameters>().map<IrTypeParameter, IrTypeParameter>(transform = local fun <anonymous>(it: IrTypeParameter): IrTypeParameter {
|
||||
return <this>.copyTypeParameter(declaration = it)
|
||||
}
|
||||
))
|
||||
withinScope<Unit>($receiver = <this>.<get-typeRemapper>(), irTypeParametersContainer = <this>, fn = local fun <anonymous>() {
|
||||
<this>.<get-typeRemapper>().withinScope<Unit>(irTypeParametersContainer = <this>, fn = local fun <anonymous>() {
|
||||
{ // BLOCK
|
||||
val tmp0_iterator: Iterator<Pair<IrTypeParameter, IrTypeParameter>> = zip<IrTypeParameter, IrTypeParameter>($receiver = <this>.<get-typeParameters>(), other = other.<get-typeParameters>()).iterator()
|
||||
val tmp0_iterator: Iterator<Pair<IrTypeParameter, IrTypeParameter>> = <this>.<get-typeParameters>().zip<IrTypeParameter, IrTypeParameter>(other = other.<get-typeParameters>()).iterator()
|
||||
while (tmp0_iterator.hasNext()) { // BLOCK
|
||||
val tmp1_loop_parameter: Pair<IrTypeParameter, IrTypeParameter> = tmp0_iterator.next()
|
||||
val thisTypeParameter: IrTypeParameter = tmp1_loop_parameter.component1()
|
||||
val otherTypeParameter: IrTypeParameter = tmp1_loop_parameter.component2()
|
||||
{ // BLOCK
|
||||
mapTo<IrType, IrType, MutableList<IrType>>($receiver = otherTypeParameter.<get-superTypes>(), destination = thisTypeParameter.<get-superTypes>(), transform = local fun <anonymous>(it: IrType): IrType {
|
||||
otherTypeParameter.<get-superTypes>().mapTo<IrType, IrType, MutableList<IrType>>(destination = thisTypeParameter.<get-superTypes>(), transform = local fun <anonymous>(it: IrType): IrType {
|
||||
return <this>.<get-typeRemapper>().remapType(type = it)
|
||||
}
|
||||
) /*~> Unit */
|
||||
|
||||
@@ -4,7 +4,7 @@ private const val BACKSLASH: Char
|
||||
|
||||
private fun Reader.nextChar(): Char? {
|
||||
return { // BLOCK
|
||||
val tmp0_safe_receiver: Int? = takeUnless<Int>($receiver = <this>.read(), predicate = local fun <anonymous>(it: Int): Boolean {
|
||||
val tmp0_safe_receiver: Int? = <this>.read().takeUnless<Int>(predicate = local fun <anonymous>(it: Int): Boolean {
|
||||
return EQEQ(arg0 = it, arg1 = -1)
|
||||
}
|
||||
)
|
||||
@@ -16,17 +16,17 @@ private fun Reader.nextChar(): Char? {
|
||||
}
|
||||
|
||||
fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) {
|
||||
var ch: Char? = nextChar($receiver = <this>)
|
||||
var ch: Char? = <this>.nextChar()
|
||||
while (when {
|
||||
EQEQ(arg0 = ch, arg1 = null).not() -> EQEQ(arg0 = ch, arg1 = quote).not()
|
||||
true -> false
|
||||
}) { // BLOCK
|
||||
when {
|
||||
EQEQ(arg0 = ch, arg1 = <get-BACKSLASH>()) -> { // BLOCK
|
||||
val tmp0_safe_receiver: Char? = nextChar($receiver = <this>)
|
||||
val tmp0_safe_receiver: Char? = <this>.nextChar()
|
||||
when {
|
||||
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
|
||||
true -> let<Char, @FlexibleNullability StringBuilder?>($receiver = tmp0_safe_receiver, block = local fun <anonymous>(it: Char): @FlexibleNullability StringBuilder? {
|
||||
true -> tmp0_safe_receiver.let<Char, @FlexibleNullability StringBuilder?>(block = local fun <anonymous>(it: Char): @FlexibleNullability StringBuilder? {
|
||||
return sb.append(p0 = it)
|
||||
}
|
||||
)
|
||||
@@ -34,7 +34,7 @@ fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) {
|
||||
} /*~> Unit */
|
||||
true -> sb.append(p0 = ch) /*~> Unit */
|
||||
}
|
||||
ch = nextChar($receiver = <this>)
|
||||
ch = <this>.nextChar()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fun test1(): Int {
|
||||
return run<String, Int>($receiver = "42", block = local fun String.<anonymous>(): Int {
|
||||
return "42".run<String, Int>(block = local fun String.<anonymous>(): Int {
|
||||
return <this>.<get-length>()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -47,7 +47,7 @@ fun test(fooImpl: IFoo, invokeImpl: IInvoke) {
|
||||
with<A, Int>(receiver = A, block = local fun A.<anonymous>(): Int {
|
||||
return with<IFoo, Int>(receiver = fooImpl, block = local fun IFoo.<anonymous>(): Int {
|
||||
return with<IInvoke, Int>(receiver = invokeImpl, block = local fun IInvoke.<anonymous>(): Int {
|
||||
return <this>.invoke($receiver = <this>.<get-foo>($receiver = <this>))
|
||||
return (<this>, (<this>, <this>).<get-foo>()).invoke()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ fun test3() {
|
||||
}
|
||||
|
||||
fun testLrmFoo1(ints: List<Int>) {
|
||||
forEach<Int>($receiver = ints, action = local fun <anonymous>(it: Int) {
|
||||
ints.forEach<Int>(action = local fun <anonymous>(it: Int) {
|
||||
when {
|
||||
EQEQ(arg0 = it, arg1 = 0) -> return Unit
|
||||
}
|
||||
@@ -40,7 +40,7 @@ fun testLrmFoo1(ints: List<Int>) {
|
||||
}
|
||||
|
||||
fun testLrmFoo2(ints: List<Int>) {
|
||||
forEach<Int>($receiver = ints, action = local fun <anonymous>(it: Int) {
|
||||
ints.forEach<Int>(action = local fun <anonymous>(it: Int) {
|
||||
when {
|
||||
EQEQ(arg0 = it, arg1 = 0) -> return Unit
|
||||
}
|
||||
|
||||
@@ -45,6 +45,6 @@ class IdType : CPointed {
|
||||
}
|
||||
|
||||
fun foo(value: IdType, cv: CInt32VarX<Int>) {
|
||||
<set-value><Int>($receiver = cv, value = value.<get-value>())
|
||||
cv.<set-value><Int>(value = value.<get-value>())
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fun <T : Any?> problematic(lss: List<List<T>>): List<T> {
|
||||
return flatMap<List<T>, @FlexibleNullability T?>($receiver = lss, transform = local fun <anonymous>(it: List<T>): @EnhancedNullability MutableList<@FlexibleNullability T?> {
|
||||
return lss.flatMap<List<T>, @FlexibleNullability T?>(transform = local fun <anonymous>(it: List<T>): @EnhancedNullability MutableList<@FlexibleNullability T?> {
|
||||
return id<@FlexibleNullability T?>(v = it) /*!! List<@FlexibleNullability T?> */
|
||||
}
|
||||
)
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
fun <K1 : Any?, V1 : Any?> Map<out K1, V1>.plus(pair: Pair<K1, V1>): Map<K1, V1> {
|
||||
return when {
|
||||
<this>.isEmpty() -> mapOf<K1, V1>(pair = pair)
|
||||
true -> apply<LinkedHashMap<@FlexibleNullability K1?, @FlexibleNullability V1?>>($receiver = TODO("IrConstructorCall"), block = local fun LinkedHashMap<@FlexibleNullability K1?, @FlexibleNullability V1?>.<anonymous>() {
|
||||
true -> TODO("IrConstructorCall").apply<LinkedHashMap<@FlexibleNullability K1?, @FlexibleNullability V1?>>(block = local fun LinkedHashMap<@FlexibleNullability K1?, @FlexibleNullability V1?>.<anonymous>() {
|
||||
<this>.put(key = pair.<get-first>(), value = pair.<get-second>()) /*~> Unit */
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
fun test() {
|
||||
val nullStr: @FlexibleNullability String? = nullString()
|
||||
val nonnullStr: @FlexibleNullability String? = nonnullString()
|
||||
foo<@FlexibleNullability String?>($receiver = nullStr) /*~> Unit */
|
||||
foo<@FlexibleNullability String?>($receiver = nonnullStr) /*~> Unit */
|
||||
fooN<@FlexibleNullability String?>($receiver = nullStr) /*~> Unit */
|
||||
fooN<@FlexibleNullability String?>($receiver = nonnullStr) /*~> Unit */
|
||||
nullStr.foo<@FlexibleNullability String?>() /*~> Unit */
|
||||
nonnullStr.foo<@FlexibleNullability String?>() /*~> Unit */
|
||||
nullStr.fooN<@FlexibleNullability String?>() /*~> Unit */
|
||||
nonnullStr.fooN<@FlexibleNullability String?>() /*~> Unit */
|
||||
}
|
||||
|
||||
inline fun <reified T : Any?> T.foo(): T {
|
||||
|
||||
@@ -13,7 +13,7 @@ fun <R : Any?> scopedFlow(block: @ExtensionFunctionType SuspendFunction2<Corouti
|
||||
fun <T : Any?> Flow<T>.onCompletion(action: @ExtensionFunctionType SuspendFunction2<FlowCollector<T>, @ParameterName(...) Throwable?, Unit>): Flow<T> {
|
||||
return unsafeFlow<T>(block = local suspend fun FlowCollector<T>.<anonymous>() {
|
||||
val safeCollector: SafeCollector<T> = TODO("IrConstructorCall")
|
||||
invokeSafely<T>($receiver = safeCollector, action = action)
|
||||
safeCollector.invokeSafely<T>(action = action)
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -28,16 +28,16 @@ inline fun <T : Any?> unsafeFlow(crossinline block: @ExtensionFunctionType Suspe
|
||||
|
||||
@Deprecated(...)
|
||||
fun <T : Any?> Flow<T>.onCompletion(action: SuspendFunction1<@ParameterName(...) Throwable?, Unit>): Flow<T> {
|
||||
return onCompletion<T>($receiver = <this>, action = local suspend fun FlowCollector<T>.<anonymous>(it: Throwable?) {
|
||||
return <this>.onCompletion<T>(action = local suspend fun FlowCollector<T>.<anonymous>(it: Throwable?) {
|
||||
action.invoke(p1 = it)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun CoroutineScope.asFairChannel(flow: Flow<*>): ReceiveChannel<Any> {
|
||||
return produce<Any>($receiver = <this>, block = local suspend fun ProducerScope<Any>.<anonymous>() {
|
||||
return <this>.produce<Any>(block = local suspend fun ProducerScope<Any>.<anonymous>() {
|
||||
val channel: ChannelCoroutine<Any> = <this>.<get-channel>() as ChannelCoroutine<Any>
|
||||
collect<Any?>($receiver = flow, action = local suspend fun <anonymous>(value: Any?) {
|
||||
flow.collect<Any?>(action = local suspend fun <anonymous>(value: Any?) {
|
||||
return channel.sendFair(element = { // BLOCK
|
||||
val tmp0_elvis_lhs: Any? = value
|
||||
when {
|
||||
@@ -52,8 +52,8 @@ private fun CoroutineScope.asFairChannel(flow: Flow<*>): ReceiveChannel<Any> {
|
||||
}
|
||||
|
||||
private fun CoroutineScope.asChannel(flow: Flow<*>): ReceiveChannel<Any> {
|
||||
return produce<Any>($receiver = <this>, block = local suspend fun ProducerScope<Any>.<anonymous>() {
|
||||
collect<Any?>($receiver = flow, action = local suspend fun <anonymous>(value: Any?) {
|
||||
return <this>.produce<Any>(block = local suspend fun ProducerScope<Any>.<anonymous>() {
|
||||
flow.collect<Any?>(action = local suspend fun <anonymous>(value: Any?) {
|
||||
return <this>.<get-channel>().send(e = { // BLOCK
|
||||
val tmp0_elvis_lhs: Any? = value
|
||||
when {
|
||||
|
||||
@@ -15,7 +15,7 @@ fun <S : Any?> select(x: S, y: S): S {
|
||||
}
|
||||
|
||||
fun <T : Any?> foo(a: Array<In<T>>, b: Array<In<String>>): Boolean {
|
||||
return ofType<Any?>($receiver = select<Array<out In<Nothing>>>(x = a, y = b).get(index = 0), y = true)
|
||||
return select<Array<out In<Nothing>>>(x = a, y = b).get(index = 0).ofType<Any?>(y = true)
|
||||
}
|
||||
|
||||
inline fun <reified K : Any?> In<K>.ofType(y: Any?): Boolean {
|
||||
|
||||
@@ -15,7 +15,7 @@ fun <S : Any?> select(x: S, y: S): S {
|
||||
}
|
||||
|
||||
fun <T : Any?> foo(a: Array<In<T>>, b: Array<In<String>>): Boolean {
|
||||
return ofType<Any?>($receiver = select<Array<out In<Any?>>>(x = a, y = b).get(index = 0), y = true)
|
||||
return select<Array<out In<Any?>>>(x = a, y = b).get(index = 0).ofType<Any?>(y = true)
|
||||
}
|
||||
|
||||
inline fun <reified K : Any?> In<K>.ofType(y: Any?): Boolean {
|
||||
|
||||
@@ -53,26 +53,26 @@ interface Z2 : A, B {
|
||||
}
|
||||
|
||||
fun testInIs1(x: In<A>, y: In<B>): Boolean {
|
||||
return isT<Any>($receiver = sel<In<Nothing>>(x = x, y = y))
|
||||
return sel<In<Nothing>>(x = x, y = y).isT<Any>()
|
||||
}
|
||||
|
||||
fun testInIs2(x: In<Z1>, y: In<Z2>): Boolean {
|
||||
return isT<Any>($receiver = sel<In<Nothing>>(x = x, y = y))
|
||||
return sel<In<Nothing>>(x = x, y = y).isT<Any>()
|
||||
}
|
||||
|
||||
fun testInIs3(x: In<A1>, y: In<A2>): Boolean {
|
||||
return isT<A>($receiver = sel<In<Nothing>>(x = x, y = y))
|
||||
return sel<In<Nothing>>(x = x, y = y).isT<A>()
|
||||
}
|
||||
|
||||
fun testInAs1(x: In<A>, y: In<B>) {
|
||||
return asT<Any>($receiver = sel<In<Nothing>>(x = x, y = y))
|
||||
return sel<In<Nothing>>(x = x, y = y).asT<Any>()
|
||||
}
|
||||
|
||||
fun testInAs2(x: In<Z1>, y: In<Z2>) {
|
||||
return asT<Any>($receiver = sel<In<Nothing>>(x = x, y = y))
|
||||
return sel<In<Nothing>>(x = x, y = y).asT<Any>()
|
||||
}
|
||||
|
||||
fun testInAs3(x: In<A1>, y: In<A2>) {
|
||||
return asT<A>($receiver = sel<In<Nothing>>(x = x, y = y))
|
||||
return sel<In<Nothing>>(x = x, y = y).asT<A>()
|
||||
}
|
||||
|
||||
|
||||
@@ -53,26 +53,26 @@ interface Z2 : A, B {
|
||||
}
|
||||
|
||||
fun testInIs1(x: In<A>, y: In<B>): Boolean {
|
||||
return isT<Any>($receiver = sel<In<Any>>(x = x, y = y))
|
||||
return sel<In<Any>>(x = x, y = y).isT<Any>()
|
||||
}
|
||||
|
||||
fun testInIs2(x: In<Z1>, y: In<Z2>): Boolean {
|
||||
return isT<Any>($receiver = sel<In<Any>>(x = x, y = y))
|
||||
return sel<In<Any>>(x = x, y = y).isT<Any>()
|
||||
}
|
||||
|
||||
fun testInIs3(x: In<A1>, y: In<A2>): Boolean {
|
||||
return isT<A>($receiver = sel<In<A>>(x = x, y = y))
|
||||
return sel<In<A>>(x = x, y = y).isT<A>()
|
||||
}
|
||||
|
||||
fun testInAs1(x: In<A>, y: In<B>) {
|
||||
return asT<Any>($receiver = sel<In<Any>>(x = x, y = y))
|
||||
return sel<In<Any>>(x = x, y = y).asT<Any>()
|
||||
}
|
||||
|
||||
fun testInAs2(x: In<Z1>, y: In<Z2>) {
|
||||
return asT<Any>($receiver = sel<In<Any>>(x = x, y = y))
|
||||
return sel<In<Any>>(x = x, y = y).asT<Any>()
|
||||
}
|
||||
|
||||
fun testInAs3(x: In<A1>, y: In<A2>) {
|
||||
return asT<A>($receiver = sel<In<A>>(x = x, y = y))
|
||||
return sel<In<A>>(x = x, y = y).asT<A>()
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -93,7 +93,7 @@ fun test3() {
|
||||
|
||||
fun test4() {
|
||||
// COMPOSITE {
|
||||
val tmp0_container: IndexedValue<@NotNull(...) @EnhancedNullability P> = first<IndexedValue<@NotNull(...) @EnhancedNullability P>>($receiver = withIndex<@NotNull(...) @EnhancedNullability P>($receiver = listOfNotNull() /*!! List<@NotNull(...) @EnhancedNullability P> */))
|
||||
val tmp0_container: IndexedValue<@NotNull(...) @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull(...) @EnhancedNullability P> */.withIndex<@NotNull(...) @EnhancedNullability P>().first<IndexedValue<@NotNull(...) @EnhancedNullability P>>()
|
||||
val x: Int = tmp0_container.component1()
|
||||
val y: @NotNull(...) @EnhancedNullability P = tmp0_container.component2()
|
||||
// }
|
||||
|
||||
Vendored
+2
-2
@@ -17,10 +17,10 @@ class C {
|
||||
}
|
||||
|
||||
fun testExt() {
|
||||
extension($receiver = s() /*!! String */)
|
||||
s() /*!! String */.extension()
|
||||
}
|
||||
|
||||
fun C.testMemberExt() {
|
||||
<this>.memberExtension($receiver = s() /*!! String */)
|
||||
(<this>, s() /*!! String */).memberExtension()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user