Recursively box/unbox nested inline value classes
See gh-34592 Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
This commit is contained in:
committed by
Sébastien Deleuze
parent
c6a9aa59a3
commit
0c2ba4e38e
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -205,6 +205,14 @@ class InvocableHandlerMethodKotlinTests {
|
||||
assertHandlerResultValue(result, "1")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun nestedValueClass() {
|
||||
this.resolvers.add(stubResolver(1L, Long::class.java))
|
||||
val method = ValueClassController::nestedValueClass.javaMethod!!
|
||||
val result = invoke(ValueClassController(), method,1L)
|
||||
assertHandlerResultValue(result, "1")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun valueClassReturnValue() {
|
||||
val method = ValueClassController::valueClassReturnValue.javaMethod!!
|
||||
@@ -212,6 +220,13 @@ class InvocableHandlerMethodKotlinTests {
|
||||
assertHandlerResultValue(result, "foo")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun nestedValueClassReturnValue() {
|
||||
val method = ValueClassController::nestedValueClassReturnValue.javaMethod!!
|
||||
val result = invoke(ValueClassController(), method)
|
||||
assertHandlerResultValue(result, "foo")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun resultOfUnitReturnValue() {
|
||||
val method = ValueClassController::resultOfUnitReturnValue.javaMethod!!
|
||||
@@ -448,8 +463,12 @@ class InvocableHandlerMethodKotlinTests {
|
||||
|
||||
fun valueClass(limit: LongValueClass) = "${limit.value}"
|
||||
|
||||
fun nestedValueClass(limit: ULongValueClass) = "${limit.value}"
|
||||
|
||||
fun valueClassReturnValue() = StringValueClass("foo")
|
||||
|
||||
fun nestedValueClassReturnValue() = NestedStringValueClass(StringValueClass("foo"))
|
||||
|
||||
fun resultOfUnitReturnValue() = Result.success(Unit)
|
||||
|
||||
fun valueClassWithDefault(limit: DoubleValueClass = DoubleValueClass(3.1)) = "${limit.value}"
|
||||
@@ -533,9 +552,15 @@ class InvocableHandlerMethodKotlinTests {
|
||||
@JvmInline
|
||||
value class StringValueClass(val value: String)
|
||||
|
||||
@JvmInline
|
||||
value class NestedStringValueClass(val value: StringValueClass)
|
||||
|
||||
@JvmInline
|
||||
value class LongValueClass(val value: Long)
|
||||
|
||||
@JvmInline
|
||||
value class ULongValueClass(val value: ULong)
|
||||
|
||||
@JvmInline
|
||||
value class DoubleValueClass(val value: Double)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user