Add serialization/deserialization of definitely-not-null types

^KT-26245 In Progress
This commit is contained in:
Denis.Zharkov
2021-04-06 17:42:56 +03:00
committed by TeamCityServer
parent 6ca6bb2d45
commit 30eb9ad32f
19 changed files with 98 additions and 11 deletions
@@ -101,7 +101,12 @@ class TypeDeserializer(
Flags.SUSPEND_TYPE.get(proto.flags) ->
createSuspendFunctionType(annotations, constructor, arguments, proto.nullable)
else ->
KotlinTypeFactory.simpleType(annotations, constructor, arguments, proto.nullable)
KotlinTypeFactory.simpleType(annotations, constructor, arguments, proto.nullable).let {
if (Flags.DEFINITELY_NOT_NULL_TYPE.get(proto.flags))
DefinitelyNotNullType.makeDefinitelyNotNull(it) ?: error("null DefinitelyNotNullType for '$it'")
else
it
}
}
val computedType = proto.abbreviatedType(c.typeTable)?.let {