fun box()

in compiler/testData/codegen/box/reflection/callBy/topLevelsWithDefaultValuesAndContextParams.kt [159:322]


fun box(): String {
    val topLevelFoo30Ref = findFunc("topLevelFoo30")
    val topLevelFoo30x = findParam(topLevelFoo30Ref, "x")
    val topLevelFoo30y = findParam(topLevelFoo30Ref, "y")
    val topLevelFoo30p1 = findParam(topLevelFoo30Ref, "p1")
    val topLevelFoo30p10 = findParam(topLevelFoo30Ref, "p10")
    val topLevelFoo30p30 = findParam(topLevelFoo30Ref, "p30")


    assertEquals(
        "a_b_42.0_10.0_30.0",
        topLevelFoo30Ref.callBy(
            mapOf(
                topLevelFoo30x to "a",
                topLevelFoo30y to "b",
                topLevelFoo30p1 to 42.0
            )
        )
    )

    assertEquals(
        "a_b_1.0_42.0_30.0",
        topLevelFoo30Ref.callBy(
            mapOf(
                topLevelFoo30x to "a",
                topLevelFoo30y to "b",
                topLevelFoo30p10 to 42.0
            )
        )
    )

    assertEquals(
        "a_b_1.0_10.0_42.0",
        topLevelFoo30Ref.callBy(
            mapOf(
                topLevelFoo30x to "a",
                topLevelFoo30y to "b",
                topLevelFoo30p30 to 42.0
            )
        )
    )

    val topLevelFoo31Ref = findFunc("topLevelFoo31")
    val topLevelFoo31x = findParam(topLevelFoo31Ref, "x")
    val topLevelFoo31y = findParam(topLevelFoo31Ref, "y")
    val topLevelFoo31p1 = findParam(topLevelFoo31Ref, "p1")
    val topLevelFoo31p10 = findParam(topLevelFoo31Ref, "p10")
    val topLevelFoo31p31 = findParam(topLevelFoo31Ref, "p31")

    assertEquals(
        "a_b_42.0_10.0_31.0",
        topLevelFoo31Ref.callBy(
            mapOf(
                topLevelFoo31x to "a",
                topLevelFoo31y to "b",
                topLevelFoo31p1 to 42.0
            )
        )
    )

    assertEquals(
        "a_b_1.0_42.0_31.0",
        topLevelFoo31Ref.callBy(
            mapOf(
                topLevelFoo31x to "a",
                topLevelFoo31y to "b",
                topLevelFoo31p10 to 42.0
            )
        )
    )

    assertEquals(
        "a_b_1.0_10.0_42.0",
        topLevelFoo31Ref.callBy(
            mapOf(
                topLevelFoo31x to "a",
                topLevelFoo31y to "b",
                topLevelFoo31p31 to 42.0
            )
        )
    )

    val topLevelFoo32Ref = findFunc("topLevelFoo32")
    val topLevelFoo32x = findParam(topLevelFoo32Ref, "x")
    val topLevelFoo32y = findParam(topLevelFoo32Ref, "y")
    val topLevelFoo32p1 = findParam(topLevelFoo32Ref, "p1")
    val topLevelFoo32p10 = findParam(topLevelFoo32Ref, "p10")
    val topLevelFoo32p32 = findParam(topLevelFoo32Ref, "p32")

    assertEquals(
        "a_b_42.0_10.0_32.0",
        topLevelFoo32Ref.callBy(
            mapOf(
                topLevelFoo32x to "a",
                topLevelFoo32y to "b",
                topLevelFoo32p1 to 42.0
            )
        )
    )

    assertEquals(
        "a_b_1.0_42.0_32.0",
        topLevelFoo32Ref.callBy(
            mapOf(
                topLevelFoo32x to "a",
                topLevelFoo32y to "b",
                topLevelFoo32p10 to 42.0
            )
        )
    )

    assertEquals(
        "a_b_1.0_10.0_42.0",
        topLevelFoo32Ref.callBy(
            mapOf(
                topLevelFoo32x to "a",
                topLevelFoo32y to "b",
                topLevelFoo32p32 to 42.0
            )
        )
    )

    val topLevelFoo33Ref = findFunc("topLevelFoo33")
    val topLevelFoo33x = findParam(topLevelFoo33Ref, "x")
    val topLevelFoo33y = findParam(topLevelFoo33Ref, "y")
    val topLevelFoo33p1 = findParam(topLevelFoo33Ref, "p1")
    val topLevelFoo33p10 = findParam(topLevelFoo33Ref, "p10")
    val topLevelFoo33p33 = findParam(topLevelFoo33Ref, "p33")

    assertEquals(
        "a_b_42.0_10.0_33.0",
        topLevelFoo33Ref.callBy(
            mapOf(
                topLevelFoo33x to "a",
                topLevelFoo33y to "b",
                topLevelFoo33p1 to 42.0
            )
        )
    )

    assertEquals(
        "a_b_1.0_42.0_33.0",
        topLevelFoo33Ref.callBy(
            mapOf(
                topLevelFoo33x to "a",
                topLevelFoo33y to "b",
                topLevelFoo33p10 to 42.0
            )
        )
    )

    assertEquals(
        "a_b_1.0_10.0_42.0",
        topLevelFoo33Ref.callBy(
            mapOf(
                topLevelFoo33x to "a",
                topLevelFoo33y to "b",
                topLevelFoo33p33 to 42.0
            )
        )
    )

    return "OK"
}