mirror of
https://github.com/corda/corda.git
synced 2025-06-23 01:19:00 +00:00
CORDA-2318 resolve type variables recursively (#4414)
* Resolve type variables recursively * Clarify test * Formatting
This commit is contained in:
@ -163,4 +163,26 @@ class RoundTripTests {
|
||||
val deserialized = DeserializationInput(factory).deserialize(bytes)
|
||||
assertEquals(mapOf("foo" to "bar"), deserialized.changedMembership.state.data.metadata)
|
||||
}
|
||||
|
||||
interface I2<T> {
|
||||
val t: T
|
||||
}
|
||||
|
||||
data class C<A, B : A>(override val t: B) : I2<B>
|
||||
|
||||
@Test
|
||||
fun recursiveTypeVariableResolution() {
|
||||
val factory = testDefaultFactoryNoEvolution()
|
||||
val instance = C<Collection<String>, List<String>>(emptyList())
|
||||
|
||||
val bytes = SerializationOutput(factory).serialize(instance)
|
||||
DeserializationInput(factory).deserialize(bytes)
|
||||
|
||||
assertEquals(
|
||||
"""
|
||||
C (erased)(t: *): I2<*>
|
||||
t: *
|
||||
""".trimIndent(),
|
||||
factory.getTypeInformation(instance::class.java).prettyPrint())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user